vera6 commited on
Commit
3e902ce
·
verified ·
1 Parent(s): 67c1619

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +1 -2
  2. app/app.py +10 -42
  3. app/derev_elevenlabs_7.ckpt +2 -2
README.md CHANGED
@@ -1,2 +1 @@
1
- VERA
2
-
 
1
+ VERA
 
app/app.py CHANGED
@@ -1,43 +1,3 @@
1
- Hugging Face's logo
2
- Hugging Face
3
- Models
4
- Datasets
5
- Spaces
6
- Community
7
- Docs
8
- Enterprise
9
- Pricing
10
-
11
-
12
- master-of-hardcore
13
- /
14
- 211048k-dnpvr
15
-
16
- like
17
- 0
18
- Model card
19
- Files and versions
20
- xet
21
- Community
22
- 211048k-dnpvr
23
- /
24
- app
25
- /
26
- app.py
27
-
28
- QuangMing
29
- ...
30
- 2ca7e4f
31
- 5 days ago
32
- raw
33
-
34
- Copy download link
35
- history
36
- blame
37
- contribute
38
- delete
39
-
40
- 10.3 kB
41
  import fastapi
42
  import shutil
43
  import os
@@ -71,7 +31,16 @@ class ModelAPI:
71
  self.noisy_audio_path = os.path.join(self.base_path, "noisy_audio")
72
  self.enhanced_audio_path = os.path.join(self.base_path, "enhanced_audio")
73
  app_dir = os.path.dirname(os.path.abspath(__file__))
74
- self.ckpt_path = glob.glob(os.path.join(app_dir, "*.ckpt"))[0]
 
 
 
 
 
 
 
 
 
75
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
76
  self.corrector = "ald"
77
  self.corrector_steps = 1
@@ -322,4 +291,3 @@ class ModelAPI:
322
  def run(self):
323
 
324
  uvicorn.run(self.app, host=self.host, port=self.port)
325
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import fastapi
2
  import shutil
3
  import os
 
31
  self.noisy_audio_path = os.path.join(self.base_path, "noisy_audio")
32
  self.enhanced_audio_path = os.path.join(self.base_path, "enhanced_audio")
33
  app_dir = os.path.dirname(os.path.abspath(__file__))
34
+
35
+ ckpt_files = glob.glob(os.path.join(app_dir, "*.ckpt"))
36
+
37
+ if not ckpt_files:
38
+ raise FileNotFoundError("No .ckpt file found in app_dir.")
39
+ elif len(ckpt_files) > 1:
40
+ raise RuntimeError("Multiple .ckpt files found in app_dir. Please keep only one.")
41
+ else:
42
+ self.ckpt_path = ckpt_files[0]
43
+
44
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
45
  self.corrector = "ald"
46
  self.corrector_steps = 1
 
291
  def run(self):
292
 
293
  uvicorn.run(self.app, host=self.host, port=self.port)
 
app/derev_elevenlabs_7.ckpt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6ddc75f01c3bc7d94d77333bf8ad93403c4bd0362279fc003177b3d50ddefa7a
3
- size 1295842026
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6f18452b4a5a2a6aff0c2db0c236cc7804ca9ce2de5d8fb794b909e4f3993f5
3
+ size 1295832473