SUDHARANJAN commited on
Commit
cac77cf
·
verified ·
1 Parent(s): 4a36b98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,10 +2,10 @@ import os
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
- # Get token from repository secrets
6
  hf_token = os.getenv("HF_TOKEN")
7
 
8
- # Load the Odia TTS model
9
  tts = pipeline(
10
  "text-to-speech",
11
  model="ai4bharat/IndicF5",
@@ -13,8 +13,8 @@ tts = pipeline(
13
  )
14
 
15
  def generate_audio(text):
16
- out = tts(text)
17
- return (22050, out["audio"])
18
 
19
  demo = gr.Interface(
20
  fn=generate_audio,
 
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
+ # Fetch Hugging Face token from secrets
6
  hf_token = os.getenv("HF_TOKEN")
7
 
8
+ # Explicitly pass the token while loading
9
  tts = pipeline(
10
  "text-to-speech",
11
  model="ai4bharat/IndicF5",
 
13
  )
14
 
15
  def generate_audio(text):
16
+ result = tts(text)
17
+ return (22050, result["audio"])
18
 
19
  demo = gr.Interface(
20
  fn=generate_audio,