hugo flores garcia commited on
Commit
4a07932
·
1 Parent(s): 3c83fc3

I think I figured out exporting for different repos?

Browse files
Files changed (3) hide show
  1. DEFAULT_HF_MODEL_REPO +1 -1
  2. README.md +4 -2
  3. scripts/exp/export.py +3 -2
DEFAULT_HF_MODEL_REPO CHANGED
@@ -1 +1 @@
1
- hugggof/vampnet-demo
 
1
+ hugggof/vampnet
README.md CHANGED
@@ -179,10 +179,12 @@ Now, log in to huggingface using the command line:
179
  huggingface-cli login
180
  ```
181
 
182
- Now, run the following command to export your model (replace `<your_finetuned_model_name>` with the name of your model, and `<HUGGINGFACE_USERNAME>` with your huggingface username):
 
 
183
 
184
  ```bash
185
- python scripts/exp/export.py --name <your_finetuned_model_name> --model latest --repo <HUGGINGFACE_USERNAME>/vampnet
186
  ```
187
 
188
  Once that's done, your model should appear on the list of available models in the gradio interface.
 
179
  huggingface-cli login
180
  ```
181
 
182
+ replace the contents of the file named `./DEFAULT_MODEL_REPO` with your `<HUGGINGFACE_USERNAME>/vampnet`. A model repo will be automatically created for you with `export.py`. The default is `hugggof/vampnet`.
183
+
184
+ Now, run the following command to export your model (replace `<your_finetuned_model_name>` with the name of your model):
185
 
186
  ```bash
187
+ python scripts/exp/export.py --name <your_finetuned_model_name> --model latest
188
  ```
189
 
190
  Once that's done, your model should appear on the list of available models in the gradio interface.
scripts/exp/export.py CHANGED
@@ -49,13 +49,14 @@ for part in ("coarse", "c2f"):
49
  # path.rename(outpath)
50
  shutil.copy(path, outpath)
51
  paths.append(outpath)
52
- print(f"moved {path} to {outpath}")
53
 
54
  print(f"uploading files to {args.repo}")
55
  # upload files to the repo
56
 
57
  # if it's a new repo, let's add the default models too
58
- defaults = [repo_dir / "c2f.pth", repo_dir / "coarse.pth", repo_dir / "codec.pth", repo_dir / "wavebeat.pth"]
 
59
 
60
  api = HfApi()
61
 
 
49
  # path.rename(outpath)
50
  shutil.copy(path, outpath)
51
  paths.append(outpath)
52
+ print(f"copied {path} to {outpath}")
53
 
54
  print(f"uploading files to {args.repo}")
55
  # upload files to the repo
56
 
57
  # if it's a new repo, let's add the default models too
58
+ if new_repo:
59
+ paths.extend([repo_dir / "c2f.pth", repo_dir / "coarse.pth", repo_dir / "codec.pth", repo_dir / "wavebeat.pth"])
60
 
61
  api = HfApi()
62