Wauplin HF staff commited on
Commit
205190d
1 Parent(s): a0d704f
Files changed (2) hide show
  1. app.py +6 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -101,7 +101,9 @@ def merge(
101
  name = "-".join(
102
  model.model.path for model in merge_config.referenced_models()
103
  )
104
- repo_name = f"mergekit-{merge_config.merge_method}-{name}".replace("/", "-")
 
 
105
  runner.log(f"Will save merged in {repo_name} once process is done.")
106
 
107
  if token is None:
@@ -110,7 +112,7 @@ def merge(
110
  )
111
 
112
  # Taken from https://github.com/arcee-ai/mergekit/blob/main/mergekit/scripts/run_yaml.py
113
- yield from runner.run_thread(
114
  run_merge,
115
  merge_config=merge_config,
116
  out_path=str(merged_path),
@@ -118,7 +120,8 @@ def merge(
118
  config_source=str(config_path),
119
  )
120
 
121
- if runner.error:
 
122
  return
123
 
124
  if hf_token is not None:
 
101
  name = "-".join(
102
  model.model.path for model in merge_config.referenced_models()
103
  )
104
+ repo_name = f"mergekit-{merge_config.merge_method}-{name}".replace("/", "-").strip("-")
105
+ if len(repo_name) > 50:
106
+ repo_name = repo_name[:25] + "-etc-" + repo_name[25:]
107
  runner.log(f"Will save merged in {repo_name} once process is done.")
108
 
109
  if token is None:
 
112
  )
113
 
114
  # Taken from https://github.com/arcee-ai/mergekit/blob/main/mergekit/scripts/run_yaml.py
115
+ yield from runner.run_python(
116
  run_merge,
117
  merge_config=merge_config,
118
  out_path=str(merged_path),
 
120
  config_source=str(config_path),
121
  )
122
 
123
+ if runner.exit_code != 0:
124
+ yield runner.log("Merge failed. Terminating here. No model has been uploaded.")
125
  return
126
 
127
  if hf_token is not None:
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  torch
2
  git+https://github.com/arcee-ai/mergekit.git
3
  # see https://huggingface.co/spaces/Wauplin/gradio_logsview
4
- gradio_logsview@https://huggingface.co/spaces/Wauplin/gradio_logsview/resolve/main/gradio_logsview-0.0.4-py3-none-any.whl
 
1
  torch
2
  git+https://github.com/arcee-ai/mergekit.git
3
  # see https://huggingface.co/spaces/Wauplin/gradio_logsview
4
+ gradio_logsview@https://huggingface.co/spaces/Wauplin/gradio_logsview/resolve/main/gradio_logsview-0.0.5-py3-none-any.whl