Make Reddit clients Alive again !!
Reddit has imposed paid API limits and that compelled developers to shutodwn their clients.
But There is a way you can Keep using your favourite reddit Client.
Reddit has imposed paid API limits and that compelled developers to shutodwn their clients.
But There is a way you can Keep using your favourite reddit Client.
We have .py
file that has source code which includes inherited classes. We want to properly parse the file and determine the inherited classes are correct before we import the file.
How to approach the problem?
We have ast
module in python which provides utility to parse the program as a tree and traverse through it. The ast.parse(source_code)
returns a ast.Module
object that is a tree of objects. We then traverse the tree to find ast.ClassDef
objects that are classes. We then check for class.bases[]
which is an array of superclass references for that class. We iterate though that to find ast.Attribute
objects that are package attributes of the class package etc (unittest.Test
here unittest
is an attribute). We then find ast.Name
object that contains the superclass name.
qpdf.exe encrypted.pdf decrypted.pdf --decrypt --password="PasswordHere123"
A good commit message looks like this:
Header line: explain the commit in one line (use the imperative)
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
OpenSUSE
# https://www.cyberciti.biz/faq/set-up-a-firewall-using-firewalld-on-opensuse-linux/
# If Not Installed
sudo zypper ref
sudo zypper update
sudo zypper install firewalld
sudo systemctl enable firewalld
# Install bitsandbytes: | |
# `nvcc --version` to get CUDA version. | |
# `pip install -i https://test.pypi.org/simple/ bitsandbytes-cudaXXX` to install for current CUDA. | |
# Example Usage: | |
# Single GPU: torchrun --nproc_per_node=1 trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=1 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True | |
# Multiple GPUs: torchrun --nproc_per_node=N trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=10 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True | |
import argparse | |
import socket | |
import torch |
# Install bitsandbytes: | |
# `nvcc --version` to get CUDA version. | |
# `pip install -i https://test.pypi.org/simple/ bitsandbytes-cudaXXX` to install for current CUDA. | |
# Example Usage: | |
# Single GPU: torchrun --nproc_per_node=1 trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=1 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True | |
# Multiple GPUs: torchrun --nproc_per_node=N trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=10 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True | |
import argparse | |
import socket | |
import sys |