skytnt commited on
Commit
e1ec387
β€’
1 Parent(s): 9582c90

add Umamusume model

Browse files
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ˜ŠπŸŽ™οΈ
4
  colorFrom: red
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 3.12.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
4
  colorFrom: red
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 3.16.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -3,6 +3,7 @@ import json
3
  import os
4
  import re
5
  import tempfile
 
6
 
7
  import librosa
8
  import numpy as np
@@ -19,23 +20,14 @@ from mel_processing import spectrogram_torch
19
 
20
  limitation = os.getenv("SYSTEM") == "spaces" # limit text and audio length in huggingface spaces
21
 
 
 
22
 
23
  def audio_postprocess(self, y):
24
- if y is None:
 
25
  return None
26
-
27
- if gr_utils.validate_url(y):
28
- file = gr_processing_utils.download_to_file(y, dir=self.temp_dir)
29
- elif isinstance(y, tuple):
30
- sample_rate, data = y
31
- file = tempfile.NamedTemporaryFile(
32
- suffix=".wav", dir=self.temp_dir, delete=False
33
- )
34
- gr_processing_utils.audio_to_file(sample_rate, data, file.name)
35
- else:
36
- file = gr_processing_utils.create_tmp_copy_of_file(y, dir=self.temp_dir)
37
-
38
- return gr_processing_utils.encode_url_or_file_to_base64(file.name)
39
 
40
 
41
  gr.Audio.postprocess = audio_postprocess
3
  import os
4
  import re
5
  import tempfile
6
+ from pathlib import Path
7
 
8
  import librosa
9
  import numpy as np
20
 
21
  limitation = os.getenv("SYSTEM") == "spaces" # limit text and audio length in huggingface spaces
22
 
23
+ audio_postprocess_ori = gr.Audio.postprocess
24
+
25
 
26
  def audio_postprocess(self, y):
27
+ data = audio_postprocess_ori(self, y)
28
+ if data is None:
29
  return None
30
+ return gr_processing_utils.encode_url_or_file_to_base64(data["name"])
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
  gr.Audio.postprocess = audio_postprocess
export_model.py CHANGED
@@ -1,8 +1,8 @@
1
  import torch
2
 
3
  if __name__ == '__main__':
4
- model_path = "saved_model/11/model.pth"
5
- output_path = "saved_model/11/model1.pth"
6
  checkpoint_dict = torch.load(model_path, map_location='cpu')
7
  checkpoint_dict_new = {}
8
  for k, v in checkpoint_dict.items():
1
  import torch
2
 
3
  if __name__ == '__main__':
4
+ model_path = "saved_model/18/model.pth"
5
+ output_path = "saved_model/18/model1.pth"
6
  checkpoint_dict = torch.load(model_path, map_location='cpu')
7
  checkpoint_dict_new = {}
8
  for k, v in checkpoint_dict.items():
saved_model/18/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aaa921889da820eee740426dc28f8b11242d5ea64635d75460b04d0f4c830f83
3
+ size 3336
saved_model/18/cover.jpg ADDED

Git LFS Details

  • SHA256: ea6f82b861d44d5626b7181acc8a58c9be6b6d36ddf983e89a8685c0da1f50db
  • Pointer size: 130 Bytes
  • Size of remote file: 43.5 kB
saved_model/18/model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a53f4eb6bf8226b3fb4a3b31436235f697692f5566039ce3491b80af9a9567a
3
+ size 158962765
saved_model/info.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8b71ff5dab7d60ce8fdbe75fa48b607574b845b4b57fa119299e1f21216d41e7
3
- size 4697
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6c673fd78f290cc81ee399069e2bd68125c768658f0a46e320070255cd93bab
3
+ size 4889