Wauplin HF staff commited on
Commit
8be82f3
1 Parent(s): 3d9edc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- yield from runner.run_command((f"HF_HOME='{tmpdirname}/.cache' " + cli).split(), cwd=merged_path)
 
 
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")