alexnasa commited on
Commit
957c938
·
verified ·
1 Parent(s): 9440825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -90,19 +90,16 @@ engine = initialize_engine(DEFAULT_TTS_MODEL_PATH, DEFAULT_AUDIO_TOKENIZER_PATH)
90
  os.environ["PROCESSED_RESULTS"] = f"{os.getcwd()}/proprocess_results"
91
 
92
  @spaces.GPU
93
- def tts_from_text(text, voice_choice):
94
- _, output = text_to_speech(engine, text, voice_preset=voice_choice)
95
  return output
96
 
97
  def speak_to_me(session_id, evt: gr.EventData):
98
  detail = getattr(evt, "data", None) or getattr(evt, "_data", {}) or {}
99
 
100
  current_text = detail.get("text", "")
101
- current_choice = detail.get("choice", "")
102
 
103
- print(current_choice)
104
-
105
- output = tts_from_text(current_text, current_choice)
106
 
107
  if session_id is None:
108
  session_id = uuid.uuid4().hex
@@ -764,7 +761,7 @@ with gr.Blocks(css=css) as demo:
764
  with gr.Column():
765
 
766
  image_input = gr.Image(label="Reference Image", type="filepath", height=512)
767
- audio_input = ExtendedAudio(label="Input Audio", type="filepath", options=["Cleon", "Cleo"], show_download_button=True)
768
 
769
 
770
  with gr.Column():
 
90
  os.environ["PROCESSED_RESULTS"] = f"{os.getcwd()}/proprocess_results"
91
 
92
  @spaces.GPU
93
+ def tts_from_text(text):
94
+ _, output = text_to_speech(engine, text)
95
  return output
96
 
97
  def speak_to_me(session_id, evt: gr.EventData):
98
  detail = getattr(evt, "data", None) or getattr(evt, "_data", {}) or {}
99
 
100
  current_text = detail.get("text", "")
 
101
 
102
+ output = tts_from_text(current_text)
 
 
103
 
104
  if session_id is None:
105
  session_id = uuid.uuid4().hex
 
761
  with gr.Column():
762
 
763
  image_input = gr.Image(label="Reference Image", type="filepath", height=512)
764
+ audio_input = ExtendedAudio(label="Input Audio", type="filepath", options=["EMPTY"], show_download_button=True)
765
 
766
 
767
  with gr.Column():