Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -163,8 +163,10 @@ def merge(yaml_config: str, hf_token: str, repo_name: str) -> Iterable[List[Log]
|
|
163 |
yield runner.log(f"Error creating repo {e}", level="ERROR")
|
164 |
return
|
165 |
|
166 |
-
# Set tmp HF_HOME to avoid filling up disk Space
|
167 |
-
|
|
|
|
|
168 |
|
169 |
if runner.exit_code != 0:
|
170 |
yield runner.log("Merge failed. Deleting repo as no model is uploaded.", level="ERROR")
|
|
|
163 |
yield runner.log(f"Error creating repo {e}", level="ERROR")
|
164 |
return
|
165 |
|
166 |
+
# Set tmp HF_HOME to avoid filling up disk Space
|
167 |
+
tmp_env = os.environ.copy() # taken from https://stackoverflow.com/a/4453495
|
168 |
+
tmp_env["HF_HOME"] = f"{tmpdirname}/.cache"
|
169 |
+
yield from runner.run_command(cli.split(), cwd=merged_path, env=tmp_env)
|
170 |
|
171 |
if runner.exit_code != 0:
|
172 |
yield runner.log("Merge failed. Deleting repo as no model is uploaded.", level="ERROR")
|