Spaces:
Running
Running
update lang
Browse files
app.py
CHANGED
@@ -21,8 +21,7 @@ def get_response_from_chatgpt(text):
|
|
21 |
response = response_str
|
22 |
logger.info(f"Response: [{response_api}]")
|
23 |
logger.info(f"conversation_id_: [{response}]")
|
24 |
-
|
25 |
-
#response = "I'm so tired. Let me lie down for a few days."
|
26 |
return response
|
27 |
|
28 |
start_work = """async() => {
|
@@ -258,18 +257,18 @@ article = """
|
|
258 |
<div class="footer">
|
259 |
<p><a href="https://chat.openai.com/chat" target="_blank">chatGPT</a>
|
260 |
by <a href="https://openai.com/" style="text-decoration: underline;" target="_blank">OpenAI</a> -
|
261 |
-
Gradio Demo by 🤗 <a href="https://
|
262 |
</p>
|
263 |
</div>
|
264 |
"""
|
265 |
|
266 |
with gr.Blocks(title='Talk to chatGPT') as demo:
|
267 |
-
gr.HTML("<p>
|
268 |
-
gr.HTML("<p>
|
269 |
with gr.Group(elem_id="page_1", visible=True) as page_1:
|
270 |
with gr.Box():
|
271 |
with gr.Row():
|
272 |
-
start_button = gr.Button("Click
|
273 |
start_button.click(fn=None, inputs=[], outputs=[], _js=start_work)
|
274 |
|
275 |
with gr.Group(elem_id="page_2", visible=False) as page_2:
|
|
|
21 |
response = response_str
|
22 |
logger.info(f"Response: [{response_api}]")
|
23 |
logger.info(f"conversation_id_: [{response}]")
|
24 |
+
|
|
|
25 |
return response
|
26 |
|
27 |
start_work = """async() => {
|
|
|
257 |
<div class="footer">
|
258 |
<p><a href="https://chat.openai.com/chat" target="_blank">chatGPT</a>
|
259 |
by <a href="https://openai.com/" style="text-decoration: underline;" target="_blank">OpenAI</a> -
|
260 |
+
Gradio Demo by 🤗 <a href="https://englishphonetics.net/about-us.html" target="_blank">Eriberto Oliveira</a>
|
261 |
</p>
|
262 |
</div>
|
263 |
"""
|
264 |
|
265 |
with gr.Blocks(title='Talk to chatGPT') as demo:
|
266 |
+
gr.HTML("<p> This is a demo of the GPT-3 model applied in the chatbot context. </p>")
|
267 |
+
gr.HTML("<p> Ask questions and be surprised by the answers</p>")
|
268 |
with gr.Group(elem_id="page_1", visible=True) as page_1:
|
269 |
with gr.Box():
|
270 |
with gr.Row():
|
271 |
+
start_button = gr.Button("Click here to chat!", elem_id="start-btn", visible=True)
|
272 |
start_button.click(fn=None, inputs=[], outputs=[], _js=start_work)
|
273 |
|
274 |
with gr.Group(elem_id="page_2", visible=False) as page_2:
|