Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,9 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
import json
|
| 4 |
import requests
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
#Streaming endpoint
|
| 7 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
|
@@ -112,7 +115,7 @@ system_msg_info = """The system message is used to set the context and behavior
|
|
| 112 |
|
| 113 |
|
| 114 |
#Modifying existing Gradio Theme
|
| 115 |
-
theme = gr.themes.Soft(primary_hue="
|
| 116 |
text_size=gr.themes.sizes.text_lg)
|
| 117 |
|
| 118 |
with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;} #chatbot {height: 520px; overflow: auto;}""",
|
|
@@ -126,7 +129,7 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
| 126 |
system_msg = gr.Textbox(label="Instruct the AI Assistant to set its beaviour", info = system_msg_info, value="")
|
| 127 |
accordion_msg = gr.HTML(value="🚧 To set System message you will have to refresh the app", visible=False)
|
| 128 |
chatbot = gr.Chatbot(label='GPT4', elem_id="chatbot")
|
| 129 |
-
inputs =
|
| 130 |
state = gr.State([])
|
| 131 |
with gr.Row():
|
| 132 |
with gr.Column(scale=7):
|
|
|
|
| 2 |
import os
|
| 3 |
import json
|
| 4 |
import requests
|
| 5 |
+
from gradio.inputs import SpeechToText
|
| 6 |
+
|
| 7 |
+
|
| 8 |
|
| 9 |
#Streaming endpoint
|
| 10 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
#Modifying existing Gradio Theme
|
| 118 |
+
theme = gr.themes.Soft(primary_hue="indigo", secondary_hue="blue", neutral_hue="blue",
|
| 119 |
text_size=gr.themes.sizes.text_lg)
|
| 120 |
|
| 121 |
with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;} #chatbot {height: 520px; overflow: auto;}""",
|
|
|
|
| 129 |
system_msg = gr.Textbox(label="Instruct the AI Assistant to set its beaviour", info = system_msg_info, value="")
|
| 130 |
accordion_msg = gr.HTML(value="🚧 To set System message you will have to refresh the app", visible=False)
|
| 131 |
chatbot = gr.Chatbot(label='GPT4', elem_id="chatbot")
|
| 132 |
+
inputs = SpeechToText(placeholder="Hi there!", label="Record an input or type a text")
|
| 133 |
state = gr.State([])
|
| 134 |
with gr.Row():
|
| 135 |
with gr.Column(scale=7):
|