Install Python3.10
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.10
Set default
git clone https://github.com/OneLevelStudio/FORGE | |
cd FORGE | |
python3 -m venv venv | |
source venv/bin/activate | |
pip install -U pip | |
pip install torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cu121 | |
pip install -r requirements_versions.txt | |
wget -P models/Stable-diffusion https://huggingface.co/onelevelstudio/diffusion/resolve/main/573152/LVSTIFY_V5.0.safetensors | |
wget -P models/Lora https://huggingface.co/onelevelstudio/diffusion/resolve/main/375993/LORA_GHOST.safetensors |
List IMG docker images | |
List CON docker ps -a | |
Build IMG docker-compose build | |
Run CON detached docker-compose up -d | |
Build IMG + Run CON detached docker-compose up -d --build | |
Stop CON + Remove CON docker-compose down | |
Remove everything unused docker system prune -a --volumes -f | |
Remove everything 1. docker stop $(docker ps -a -q) |
zrok reserve public 1234 --unique-name baobuiquang | |
zrok share reserved baobuiquang public |
ssh -L 1234:localhost:1234 [email protected] | |
jupyter lab --no-browser --port=1234 |
# Boilerplate: https://github.com/baobuiquang/fastapi | |
from fastapi.middleware.cors import CORSMiddleware | |
from fastapi.staticfiles import StaticFiles | |
from fastapi import FastAPI | |
import uvicorn | |
import _config | |
# For images processing | |
from fastapi import File, UploadFile |
# Python | |
call py --version | |
# Virtual Environment | |
call py -m venv venv | |
call venv\Scripts\activate | |
call py -m pip install -U pip | |
call py run.py | |
# Install dependencies |
# Create folder | |
import os | |
os.makedirs("my/path", exist_ok=True) | |
# Read and write CSV | |
import pandas as pd | |
df = pd.read_csv('input_data.csv', encoding='utf-8') | |
df.to_csv('output_data.csv', encoding='utf-8', index=False) |