Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import openai
|
2 |
import gradio as gr
|
3 |
from serpapi import GoogleSearch
|
@@ -70,13 +71,28 @@ def openai_chat(prompt_):
|
|
70 |
|
71 |
def saab(input, hist=[]):
|
72 |
_user_ = "π€: "
|
73 |
-
_saab_ = "
|
74 |
output = openai_chat(input)
|
75 |
hist.append((_user_+input, _saab_+output))
|
76 |
return hist, hist
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
import openai
|
3 |
import gradio as gr
|
4 |
from serpapi import GoogleSearch
|
|
|
71 |
|
72 |
def saab(input, hist=[]):
|
73 |
_user_ = "π€: "
|
74 |
+
_saab_ = "ππ€π: "
|
75 |
output = openai_chat(input)
|
76 |
hist.append((_user_+input, _saab_+output))
|
77 |
return hist, hist
|
78 |
|
79 |
+
description = '''
|
80 |
+
# ππ€ Virtual Standards Support Assistant π€π
|
81 |
+
Welcome to a dedicated space for Standards experts who need a hand! Our mission is to provide a robust support
|
82 |
+
system for all the standards professionals out there!!'''
|
83 |
+
title = "ππ€ Virtual Standards Support Assistant π€π"
|
84 |
+
with gr.Blocks() as demo:
|
85 |
+
gr.Markdown(description)
|
86 |
+
chatbot = gr.Chatbot()
|
87 |
+
state = gr.State([])
|
88 |
+
|
89 |
+
with gr.Row():
|
90 |
+
txt = gr.Textbox(
|
91 |
+
show_label=False, placeholder="Ask a question and press ENTER"
|
92 |
+
).style(container=False)
|
93 |
+
btn = gr.Button(value="Submit")
|
94 |
+
btn.click(saab, [txt, state], [chatbot, state])
|
95 |
+
|
96 |
+
# txt.submit(saab, [txt, state], [chatbot, state])
|
97 |
+
|
98 |
+
demo.launch()
|