gabrielchua commited on
Commit
17dad6c
1 Parent(s): 8a1ab06

use zeroGPU

Browse files
Files changed (3) hide show
  1. app.py +4 -4
  2. requirements.txt +2 -0
  3. utils.py +2 -1
app.py CHANGED
@@ -204,15 +204,15 @@ demo = gr.Interface(
204
  [str(Path("examples/1310.4546v1.pdf"))],
205
  "",
206
  "Fun",
207
- "Female",
208
- "Medium (3-5 min)",
209
  "English"
210
  ],
211
  [
212
  [],
213
  "https://en.wikipedia.org/wiki/Hugging_Face",
214
  "Fun",
215
- "Male"
216
  "Short (1-2 min)",
217
  "English"
218
  ],
@@ -220,7 +220,7 @@ demo = gr.Interface(
220
  [],
221
  "https://simple.wikipedia.org/wiki/Taylor_Swift",
222
  "Fun",
223
- "Female"
224
  "Short (1-2 min)",
225
  "English"
226
  ],
 
204
  [str(Path("examples/1310.4546v1.pdf"))],
205
  "",
206
  "Fun",
207
+ "Male",
208
+ "Medium (3-5 min)",
209
  "English"
210
  ],
211
  [
212
  [],
213
  "https://en.wikipedia.org/wiki/Hugging_Face",
214
  "Fun",
215
+ "Male",
216
  "Short (1-2 min)",
217
  "English"
218
  ],
 
220
  [],
221
  "https://simple.wikipedia.org/wiki/Taylor_Swift",
222
  "Fun",
223
+ "Female",
224
  "Short (1-2 min)",
225
  "English"
226
  ],
requirements.txt CHANGED
@@ -7,4 +7,6 @@ promptic==0.7.5
7
  pydantic==2.7
8
  pypdf==4.1
9
  sentry-sdk==2.5
 
 
10
  tenacity==8.3
 
7
  pydantic==2.7
8
  pypdf==4.1
9
  sentry-sdk==2.5
10
+ spaces==0.30.2
11
+
12
  tenacity==8.3
utils.py CHANGED
@@ -13,6 +13,7 @@ import tempfile
13
 
14
 
15
  import soundfile as sf
 
16
  import torch
17
  from gradio_client import Client
18
  from openai import OpenAI
@@ -78,7 +79,7 @@ def parse_url(url: str) -> str:
78
  response = requests.get(full_url, timeout=60)
79
  return response.text
80
 
81
-
82
  def generate_audio(text: str, speaker: str, language: str, voice: str) -> str:
83
  """Generate audio using the local Parler TTS model or HuggingFace client."""
84
 
 
13
 
14
 
15
  import soundfile as sf
16
+ import spaces
17
  import torch
18
  from gradio_client import Client
19
  from openai import OpenAI
 
79
  response = requests.get(full_url, timeout=60)
80
  return response.text
81
 
82
+ @spaces.GPU
83
  def generate_audio(text: str, speaker: str, language: str, voice: str) -> str:
84
  """Generate audio using the local Parler TTS model or HuggingFace client."""
85