ariankhalfani commited on
Commit
709897b
·
verified ·
1 Parent(s): f78121a

Update LLMwithvoice.py

Browse files
Files changed (1) hide show
  1. LLMwithvoice.py +6 -1
LLMwithvoice.py CHANGED
@@ -38,4 +38,9 @@ def chat_with_roberta(api_token, question, context):
38
  def generate_speech(api_token, text):
39
  payload = {"inputs": text}
40
  audio_bytes = query_tts(api_token, payload)
41
- return audio_bytes
 
 
 
 
 
 
38
  def generate_speech(api_token, text):
39
  payload = {"inputs": text}
40
  audio_bytes = query_tts(api_token, payload)
41
+ return audio_bytes
42
+
43
+ def gradio_interface(api_token, context, question):
44
+ answer = chat_with_roberta(api_token, question, context)
45
+ audio_bytes = generate_speech(api_token, answer)
46
+ return answer, audio_bytes