Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
|
@@ -96,7 +96,7 @@ def merge(
|
|
| 96 |
merged_path.mkdir(parents=True, exist_ok=True)
|
| 97 |
config_path = merged_path / "config.yaml"
|
| 98 |
config_path.write_text(yaml_config)
|
| 99 |
-
runner.log(f"Merge configuration saved in {config_path}")
|
| 100 |
|
| 101 |
if token is not None and repo_name == "":
|
| 102 |
name = "-".join(
|
|
@@ -106,14 +106,13 @@ def merge(
|
|
| 106 |
runner.log(f"Will save merged in {repo_name} once process is done.")
|
| 107 |
|
| 108 |
if token is None:
|
| 109 |
-
runner.log(
|
| 110 |
"No token provided, merge will run in dry-run mode (no upload at the end of the process)."
|
| 111 |
)
|
| 112 |
|
| 113 |
# Taken from https://github.com/arcee-ai/mergekit/blob/main/mergekit/scripts/run_yaml.py
|
| 114 |
-
yield from
|
| 115 |
run_merge,
|
| 116 |
-
log_level=logging.INFO,
|
| 117 |
merge_config=merge_config,
|
| 118 |
out_path=merged_path,
|
| 119 |
options=merge_options,
|
|
@@ -125,15 +124,15 @@ def merge(
|
|
| 125 |
|
| 126 |
if hf_token is not None:
|
| 127 |
api = huggingface_hub.HfApi(token=hf_token)
|
| 128 |
-
runner.log("Creating repo")
|
| 129 |
repo_url = api.create_repo(repo_name, exist_ok=True)
|
| 130 |
|
| 131 |
-
runner.log(f"Repo created: {repo_url}")
|
| 132 |
folder_url = api.upload_folder(
|
| 133 |
repo_id=repo_url.repo_id, folder_path=merged_path
|
| 134 |
)
|
| 135 |
|
| 136 |
-
runner.log(f"Model successfully uploaded to {folder_url}")
|
| 137 |
|
| 138 |
|
| 139 |
with gr.Blocks() as demo:
|
|
|
|
| 96 |
merged_path.mkdir(parents=True, exist_ok=True)
|
| 97 |
config_path = merged_path / "config.yaml"
|
| 98 |
config_path.write_text(yaml_config)
|
| 99 |
+
yield runner.log(f"Merge configuration saved in {config_path}")
|
| 100 |
|
| 101 |
if token is not None and repo_name == "":
|
| 102 |
name = "-".join(
|
|
|
|
| 106 |
runner.log(f"Will save merged in {repo_name} once process is done.")
|
| 107 |
|
| 108 |
if token is None:
|
| 109 |
+
yield runner.log(
|
| 110 |
"No token provided, merge will run in dry-run mode (no upload at the end of the process)."
|
| 111 |
)
|
| 112 |
|
| 113 |
# Taken from https://github.com/arcee-ai/mergekit/blob/main/mergekit/scripts/run_yaml.py
|
| 114 |
+
yield from runner.run_thread(
|
| 115 |
run_merge,
|
|
|
|
| 116 |
merge_config=merge_config,
|
| 117 |
out_path=merged_path,
|
| 118 |
options=merge_options,
|
|
|
|
| 124 |
|
| 125 |
if hf_token is not None:
|
| 126 |
api = huggingface_hub.HfApi(token=hf_token)
|
| 127 |
+
yield runner.log("Creating repo")
|
| 128 |
repo_url = api.create_repo(repo_name, exist_ok=True)
|
| 129 |
|
| 130 |
+
yield runner.log(f"Repo created: {repo_url}")
|
| 131 |
folder_url = api.upload_folder(
|
| 132 |
repo_id=repo_url.repo_id, folder_path=merged_path
|
| 133 |
)
|
| 134 |
|
| 135 |
+
yield runner.log(f"Model successfully uploaded to {folder_url}")
|
| 136 |
|
| 137 |
|
| 138 |
with gr.Blocks() as demo:
|