Spaces:
Runtime error
Runtime error
Add option to give standalone prompt
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ with (gr.Blocks() as app):
|
|
12 |
with gr.Row() as select_author:
|
13 |
chat_btn = gr.Button(value='Start chat')
|
14 |
|
15 |
-
# ------------------------------------- Chat -------------------------------------------
|
16 |
with gr.Row(visible=False) as chatbot:
|
17 |
with gr.Column():
|
18 |
with gr.Row():
|
@@ -27,7 +27,7 @@ with (gr.Blocks() as app):
|
|
27 |
label='Get only audio', info='This is free but makes API slower'
|
28 |
)
|
29 |
radio = gr.Radio(
|
30 |
-
choices=['local', 'remote'], value='
|
31 |
)
|
32 |
|
33 |
with gr.Column():
|
@@ -40,11 +40,13 @@ with (gr.Blocks() as app):
|
|
40 |
audio = gr.Audio(sources=['microphone'], type='filepath', label='Tell me your question')
|
41 |
button_audio = gr.Button(value='Submit audio')
|
42 |
|
|
|
43 |
with gr.Tab('Option 2'):
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
|
|
48 |
chatbot_option2 = gr.Chatbot(label='Bella Nosotras')
|
49 |
start_button = gr.Button()
|
50 |
message = gr.Textbox(visible=False)
|
|
|
12 |
with gr.Row() as select_author:
|
13 |
chat_btn = gr.Button(value='Start chat')
|
14 |
|
15 |
+
# ------------------------------------- Chat API -------------------------------------------
|
16 |
with gr.Row(visible=False) as chatbot:
|
17 |
with gr.Column():
|
18 |
with gr.Row():
|
|
|
27 |
label='Get only audio', info='This is free but makes API slower'
|
28 |
)
|
29 |
radio = gr.Radio(
|
30 |
+
choices=['local', 'remote'], value='local', label='Backend used', visible=False
|
31 |
)
|
32 |
|
33 |
with gr.Column():
|
|
|
40 |
audio = gr.Audio(sources=['microphone'], type='filepath', label='Tell me your question')
|
41 |
button_audio = gr.Button(value='Submit audio')
|
42 |
|
43 |
+
# ------------------------------------- Customize prompts -------------------------------------------
|
44 |
with gr.Tab('Option 2'):
|
45 |
+
with gr.Row():
|
46 |
+
prompt_questions = gr.Textbox(label='Enter you prompt for standalone questions')
|
47 |
+
prompt_main = gr.Textbox(label='Enter your prompt for answerings questions')
|
48 |
|
49 |
+
msg_history = gr.State([])
|
50 |
chatbot_option2 = gr.Chatbot(label='Bella Nosotras')
|
51 |
start_button = gr.Button()
|
52 |
message = gr.Textbox(visible=False)
|