chargoddard commited on
Commit
e7f2f83
1 Parent(s): cc0dc31

Allow merging LoRA

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -170,7 +170,8 @@ def merge(yaml_config: str, hf_token: str, repo_name: str) -> Iterable[List[Log]
170
  # Set tmp HF_HOME to avoid filling up disk Space
171
  tmp_env = os.environ.copy() # taken from https://stackoverflow.com/a/4453495
172
  tmp_env["HF_HOME"] = f"{tmpdirname}/.cache"
173
- yield from runner.run_command(cli.split(), cwd=merged_path, env=tmp_env)
 
174
 
175
  if runner.exit_code != 0:
176
  yield runner.log("Merge failed. Deleting repo as no model is uploaded.", level="ERROR")
 
170
  # Set tmp HF_HOME to avoid filling up disk Space
171
  tmp_env = os.environ.copy() # taken from https://stackoverflow.com/a/4453495
172
  tmp_env["HF_HOME"] = f"{tmpdirname}/.cache"
173
+ full_cli = cli + f" --lora-merge-cache {tmpdirname}/.lora_cache"
174
+ yield from runner.run_command(full_cli.split(), cwd=merged_path, env=tmp_env)
175
 
176
  if runner.exit_code != 0:
177
  yield runner.log("Merge failed. Deleting repo as no model is uploaded.", level="ERROR")