Spaces:
Runtime error
Runtime error
michal
commited on
Commit
Β·
46cd566
1
Parent(s):
6f0ed79
fixes
Browse files- app.py +5 -8
- audios/tempfile.mp3 +0 -0
app.py
CHANGED
@@ -379,7 +379,7 @@ class ChatWrapper:
|
|
379 |
self.lock = Lock()
|
380 |
|
381 |
def __call__(
|
382 |
-
self,
|
383 |
trace_chain: bool, speak_text: bool, talking_head: bool, monologue: bool, express_chain: Optional[LLMChain],
|
384 |
num_words, formality, anticipation_level, joy_level, trust_level,
|
385 |
fear_level, surprise_level, sadness_level, disgust_level, anger_level,
|
@@ -639,8 +639,8 @@ with gr.Blocks(css=CSS) as block:
|
|
639 |
"""<b><center>GPT + Whisper + Polly + Personalized + Multi-lingual + Empathetic + Agent: Human Care Humana.</center></b>
|
640 |
<p><center>New feature in <b>Translate to</b>: Choose <b>Language level</b> (e.g. for conversation practice or explain like I'm five)</center></p>""")
|
641 |
|
642 |
-
openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...)",
|
643 |
-
|
644 |
with gr.Row():
|
645 |
with gr.Column(scale=1, min_width=TALKING_HEAD_WIDTH, visible=True):
|
646 |
speak_text_cb = gr.Checkbox(label="Enable speech", value=True)
|
@@ -869,7 +869,7 @@ with gr.Blocks(css=CSS) as block:
|
|
869 |
Powered by <a href='https://github.com/hwchase17/langchain'>LangChain π¦οΈπ</a>
|
870 |
</center>""")
|
871 |
|
872 |
-
message.submit(chat, inputs=[
|
873 |
speak_text_state, talking_head_state, monologue_state,
|
874 |
express_chain_state, num_words_state, formality_state,
|
875 |
anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
|
@@ -878,7 +878,7 @@ with gr.Blocks(css=CSS) as block:
|
|
878 |
outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
|
879 |
# outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
|
880 |
|
881 |
-
submit.click(chat, inputs=[
|
882 |
speak_text_state, talking_head_state, monologue_state,
|
883 |
express_chain_state, num_words_state, formality_state,
|
884 |
anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
|
@@ -887,8 +887,5 @@ with gr.Blocks(css=CSS) as block:
|
|
887 |
outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
|
888 |
# outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
|
889 |
|
890 |
-
openai_api_key_textbox.change(set_openai_api_key,
|
891 |
-
inputs=[openai_api_key_textbox],
|
892 |
-
outputs=[chain_state, express_chain_state, llm_state])
|
893 |
|
894 |
block.launch(debug=True)
|
|
|
379 |
self.lock = Lock()
|
380 |
|
381 |
def __call__(
|
382 |
+
self, inp: str, history: Optional[Tuple[str, str]], chain: Optional[ConversationChain],
|
383 |
trace_chain: bool, speak_text: bool, talking_head: bool, monologue: bool, express_chain: Optional[LLMChain],
|
384 |
num_words, formality, anticipation_level, joy_level, trust_level,
|
385 |
fear_level, surprise_level, sadness_level, disgust_level, anger_level,
|
|
|
639 |
"""<b><center>GPT + Whisper + Polly + Personalized + Multi-lingual + Empathetic + Agent: Human Care Humana.</center></b>
|
640 |
<p><center>New feature in <b>Translate to</b>: Choose <b>Language level</b> (e.g. for conversation practice or explain like I'm five)</center></p>""")
|
641 |
|
642 |
+
# openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...)",
|
643 |
+
# show_label=False, lines=1, type='password')
|
644 |
with gr.Row():
|
645 |
with gr.Column(scale=1, min_width=TALKING_HEAD_WIDTH, visible=True):
|
646 |
speak_text_cb = gr.Checkbox(label="Enable speech", value=True)
|
|
|
869 |
Powered by <a href='https://github.com/hwchase17/langchain'>LangChain π¦οΈπ</a>
|
870 |
</center>""")
|
871 |
|
872 |
+
message.submit(chat, inputs=[message, history_state, chain_state, trace_chain_state,
|
873 |
speak_text_state, talking_head_state, monologue_state,
|
874 |
express_chain_state, num_words_state, formality_state,
|
875 |
anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
|
|
|
878 |
outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
|
879 |
# outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
|
880 |
|
881 |
+
submit.click(chat, inputs=[message, history_state, chain_state, trace_chain_state,
|
882 |
speak_text_state, talking_head_state, monologue_state,
|
883 |
express_chain_state, num_words_state, formality_state,
|
884 |
anticipation_level_state, joy_level_state, trust_level_state, fear_level_state,
|
|
|
887 |
outputs=[chatbot, history_state, video_html, my_file, audio_html, tmp_aud_file, message])
|
888 |
# outputs=[chatbot, history_state, audio_html, tmp_aud_file, message])
|
889 |
|
|
|
|
|
|
|
890 |
|
891 |
block.launch(debug=True)
|
audios/tempfile.mp3
CHANGED
Binary files a/audios/tempfile.mp3 and b/audios/tempfile.mp3 differ
|
|