Spaces:
Running
Running
phucbienvan
commited on
Commit
·
0f1518a
1
Parent(s):
16f177c
update
Browse files- app.py +2 -2
- requirements.txt +1 -0
- test_model.py +2 -2
app.py
CHANGED
@@ -6,7 +6,7 @@ from typing import List, Tuple
|
|
6 |
import gradio as gr
|
7 |
import torch
|
8 |
import torchaudio
|
9 |
-
import spaces
|
10 |
from dataclasses import dataclass
|
11 |
from generator import Segment, load_csm_1b
|
12 |
from huggingface_hub import login
|
@@ -144,7 +144,7 @@ def generate_speech(
|
|
144 |
|
145 |
progress(1.0, "Completed!")
|
146 |
return output_path
|
147 |
-
except
|
148 |
# Handle ZeroGPU quota exceeded error
|
149 |
error_message = str(e)
|
150 |
if "GPU quota exceeded" in error_message:
|
|
|
6 |
import gradio as gr
|
7 |
import torch
|
8 |
import torchaudio
|
9 |
+
# import spaces
|
10 |
from dataclasses import dataclass
|
11 |
from generator import Segment, load_csm_1b
|
12 |
from huggingface_hub import login
|
|
|
144 |
|
145 |
progress(1.0, "Completed!")
|
146 |
return output_path
|
147 |
+
except Exception as e:
|
148 |
# Handle ZeroGPU quota exceeded error
|
149 |
error_message = str(e)
|
150 |
if "GPU quota exceeded" in error_message:
|
requirements.txt
CHANGED
@@ -7,3 +7,4 @@ moshi==0.2.2
|
|
7 |
torchtune==0.4.0
|
8 |
torchao==0.9.0
|
9 |
silentcipher @ git+https://github.com/SesameAILabs/silentcipher@master
|
|
|
|
7 |
torchtune==0.4.0
|
8 |
torchao==0.9.0
|
9 |
silentcipher @ git+https://github.com/SesameAILabs/silentcipher@master
|
10 |
+
gradio==4.44.1
|
test_model.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
import torch
|
3 |
import torchaudio
|
4 |
-
import spaces
|
5 |
from generator import Segment, load_csm_1b
|
6 |
from huggingface_hub import login
|
7 |
|
@@ -22,7 +22,7 @@ def login_huggingface():
|
|
22 |
print("No token provided. Some models may not be accessible.")
|
23 |
return False
|
24 |
|
25 |
-
@spaces.GPU
|
26 |
def generate_test_audio(text, speaker_id, device):
|
27 |
"""Generate test audio using ZeroGPU"""
|
28 |
generator = load_csm_1b(device=device)
|
|
|
1 |
import os
|
2 |
import torch
|
3 |
import torchaudio
|
4 |
+
# import spaces
|
5 |
from generator import Segment, load_csm_1b
|
6 |
from huggingface_hub import login
|
7 |
|
|
|
22 |
print("No token provided. Some models may not be accessible.")
|
23 |
return False
|
24 |
|
25 |
+
# @spaces.GPU
|
26 |
def generate_test_audio(text, speaker_id, device):
|
27 |
"""Generate test audio using ZeroGPU"""
|
28 |
generator = load_csm_1b(device=device)
|