Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
josebenitezg committed Aug 26, 2024
1 parent 52fe18e commit 0fb8049
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

DOMAIN = os.getenv("DOMAIN")

REPLICATE_OWNER = "josebenitezg"
HF_OWNER = "joselobenitezg"


logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from gradio_app import login_demo, main_demo
import gradio as gr
from pathlib import Path
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

Expand All @@ -16,7 +15,6 @@

static_dir = Path("./static")
app.mount("/static", StaticFiles(directory=static_dir, html=True), name="static")
#app.mount("/assets", StaticFiles(directory="assets", html=True), name="assets")

app.add_middleware(SessionMiddleware, secret_key=SECRET_KEY, max_age=3600)

Expand Down
6 changes: 2 additions & 4 deletions services/train_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import os
from huggingface_hub import create_repo
from database import create_lora_models

REPLICATE_OWNER = "josebenitezg"
from config import REPLICATE_OWNER, HF_OWNER

def lora_pipeline(user_id, zip_path, model_name, trigger_word="TOK", steps=1000, lora_rank=16, batch_size=1, autocaption=True, learning_rate=0.0004):
print(f'Creating dataset for {model_name}')
model_name = model_name.lower().replace(' ', '_')
hf_repo_name = f"joselobenitezg/flux-dev-{model_name}"
hf_repo_name = f"{HF_OWNER}/flux-dev-{model_name}"
replicate_repo_name = f"josebenitezg/flux-dev-{model_name}"
create_repo(hf_repo_name, repo_type='model')

Expand Down Expand Up @@ -45,7 +44,6 @@ def lora_pipeline(user_id, zip_path, model_name, trigger_word="TOK", steps=1000,
destination=f"{model.owner}/{model.name}"
)

print(f"training: {training.keys()}")
print(f"Training started: {training.status}")
print(f"Training URL: https://replicate.com/p/{training.id}")
print(f"Creating model in Database")
Expand Down

0 comments on commit 0fb8049

Please sign in to comment.