Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -283,9 +283,9 @@ def start_training(
|
|
283 |
|
284 |
cmd = f"autotrain spacerunner --project-name {slugged_lora_name} --script-path {dataset_folder}"
|
285 |
cmd += f" --username {profile.username} --token {hf_token} --backend spaces-l4x1"
|
286 |
-
outcome = subprocess.run(cmd.split())
|
287 |
|
288 |
-
if outcome.returncode == 0:
|
289 |
return f"""# Your training has started.
|
290 |
## - Training Status: <a href='https://huggingface.co/spaces/{profile.username}/autotrain-{slugged_lora_name}?logs=container'>{profile.username}/autotrain-{slugged_lora_name}</a> <small>(in the logs tab)</small>
|
291 |
## - Model page: <a href='https://huggingface.co/{profile.username}/{slugged_lora_name}'>{profile.username}/{slugged_lora_name}</a> <small>(will be available when training finishes)</small>"""
|
|
|
283 |
|
284 |
cmd = f"autotrain spacerunner --project-name {slugged_lora_name} --script-path {dataset_folder}"
|
285 |
cmd += f" --username {profile.username} --token {hf_token} --backend spaces-l4x1"
|
286 |
+
outcome = subprocess.run(cmd.split(), capture_output=True, text=True)
|
287 |
|
288 |
+
if outcome.returncode == 0 or "You already created this space repo" in (outcome.stdout + outcome.stderr):
|
289 |
return f"""# Your training has started.
|
290 |
## - Training Status: <a href='https://huggingface.co/spaces/{profile.username}/autotrain-{slugged_lora_name}?logs=container'>{profile.username}/autotrain-{slugged_lora_name}</a> <small>(in the logs tab)</small>
|
291 |
## - Model page: <a href='https://huggingface.co/{profile.username}/{slugged_lora_name}'>{profile.username}/{slugged_lora_name}</a> <small>(will be available when training finishes)</small>"""
|