Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
demo = gr.Interface(
|
| 7 |
-
fn=greet,
|
| 8 |
-
inputs="textbox",
|
| 9 |
-
outputs=["Model 1","Model 2", "Model 3"],
|
| 10 |
-
)
|
| 11 |
-
|
| 12 |
if __name__ == "__main__":
|
| 13 |
-
demo.launch()
|
|
|
|
| 1 |
+
#build theme
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
def chat1(message,history):
|
| 6 |
+
history = history or []
|
| 7 |
+
message = message.lower()
|
| 8 |
+
if message.startswith("how many"):
|
| 9 |
+
response = ("1 to 10")
|
| 10 |
+
else:
|
| 11 |
+
response = ("whatever man")
|
| 12 |
+
|
| 13 |
+
history.append((message, response))
|
| 14 |
+
return history, history
|
| 15 |
+
|
| 16 |
+
chatbot = gr.Chatbot()
|
| 17 |
+
chatbot1 = gr.Chatbot()
|
| 18 |
+
chatbot2 = gr.Chatbot()
|
| 19 |
+
|
| 20 |
+
with gr.Blocks() as demo:
|
| 21 |
+
gr.Markdown("Efficient Fine Tuning - Bert Model for Text Classification")
|
| 22 |
+
with gr.Row():
|
| 23 |
+
with gr.Column():
|
| 24 |
+
inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
|
| 25 |
+
btn = gr.Button("Run")
|
| 26 |
+
|
| 27 |
+
with gr.Row():
|
| 28 |
+
with gr.Column():
|
| 29 |
+
out = gr.Textbox()
|
| 30 |
+
with gr.Column():
|
| 31 |
+
out1 = gr.Textbox()
|
| 32 |
+
with gr.Column():
|
| 33 |
+
out2 = gr.Textbox()
|
| 34 |
+
|
| 35 |
+
btn.click(fn=chat1, inputs=inp, outputs=out)
|
| 36 |
+
btn.click(fn=chat1, inputs=inp, outputs=out1)
|
| 37 |
+
btn.click(fn=chat1, inputs=inp, outputs=out2)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
if __name__ == "__main__":
|
| 40 |
+
demo.launch()
|