Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -194,6 +194,14 @@ def start_training(
|
|
194 |
print("Started training")
|
195 |
slugged_lora_name = slugify(lora_name)
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
# Load the default config
|
198 |
with open("train_lora_flux_24gb.yaml" if is_spaces else "ai-toolkit/config/examples/train_lora_flux_24gb.yaml", "r") as f:
|
199 |
config = yaml.safe_load(f)
|
@@ -208,6 +216,7 @@ def start_training(
|
|
208 |
config["config"]["process"][0]["network"]["linear_alpha"] = int(rank)
|
209 |
config["config"]["process"][0]["datasets"][0]["folder_path"] = dataset_folder
|
210 |
config["config"]["process"][0]["save"]["push_to_hub"] = True
|
|
|
211 |
try:
|
212 |
username = whoami()["name"] if not is_spaces else profile.username
|
213 |
except:
|
@@ -307,12 +316,12 @@ def start_training(
|
|
307 |
commit_message="Pushing training files from controller"
|
308 |
)
|
309 |
|
310 |
-
model_repo_id = f"{profile.username}/{slugged_lora_name}"
|
311 |
-
try:
|
312 |
-
api.create_repo(repo_id=model_repo_id, repo_type="model", private=True)
|
313 |
-
print(f"Created model repo {model_repo_id}")
|
314 |
-
except Exception as e:
|
315 |
-
print(f"Model repo might already exist: {e}")
|
316 |
|
317 |
|
318 |
cmd = f"autotrain spacerunner --project-name {slugged_lora_name} --script-path {dataset_folder}"
|
|
|
194 |
print("Started training")
|
195 |
slugged_lora_name = slugify(lora_name)
|
196 |
|
197 |
+
# Create model repo
|
198 |
+
model_repo_id = f"{profile.username}/{slugged_lora_name}"
|
199 |
+
try:
|
200 |
+
api.create_repo(repo_id=model_repo_id, repo_type="model", private=True)
|
201 |
+
print(f"Created model repo {model_repo_id}")
|
202 |
+
except Exception as e:
|
203 |
+
print(f"Model repo might already exist: {e}")
|
204 |
+
|
205 |
# Load the default config
|
206 |
with open("train_lora_flux_24gb.yaml" if is_spaces else "ai-toolkit/config/examples/train_lora_flux_24gb.yaml", "r") as f:
|
207 |
config = yaml.safe_load(f)
|
|
|
216 |
config["config"]["process"][0]["network"]["linear_alpha"] = int(rank)
|
217 |
config["config"]["process"][0]["datasets"][0]["folder_path"] = dataset_folder
|
218 |
config["config"]["process"][0]["save"]["push_to_hub"] = True
|
219 |
+
config["config"]["process"][0]["save"]["hf_repo_id"] = model_repo_id
|
220 |
try:
|
221 |
username = whoami()["name"] if not is_spaces else profile.username
|
222 |
except:
|
|
|
316 |
commit_message="Pushing training files from controller"
|
317 |
)
|
318 |
|
319 |
+
# model_repo_id = f"{profile.username}/{slugged_lora_name}"
|
320 |
+
# try:
|
321 |
+
# api.create_repo(repo_id=model_repo_id, repo_type="model", private=True)
|
322 |
+
# print(f"Created model repo {model_repo_id}")
|
323 |
+
# except Exception as e:
|
324 |
+
# print(f"Model repo might already exist: {e}")
|
325 |
|
326 |
|
327 |
cmd = f"autotrain spacerunner --project-name {slugged_lora_name} --script-path {dataset_folder}"
|