Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
-
from temp import
|
|
|
|
|
3 |
|
4 |
with gr.Blocks(fill_height=True, fill_width=True) as demo:
|
5 |
-
gr.ChatInterface(chat)
|
6 |
with gr.Row():
|
7 |
-
input_tokens = gr.Textbox(value=
|
8 |
-
output_tokens = gr.Textbox(value=
|
9 |
with gr.Column():
|
10 |
btn = gr.Button("Reset")
|
11 |
count_tokens = gr.Button('Count Tokens')
|
12 |
-
btn.click(reset, outputs=[output_tokens, input_tokens])
|
13 |
-
count_tokens.click(
|
14 |
|
15 |
demo.launch(share=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
from temp import MailChatBot
|
3 |
+
|
4 |
+
MODEL = MailChatBot()
|
5 |
|
6 |
with gr.Blocks(fill_height=True, fill_width=True) as demo:
|
7 |
+
gr.ChatInterface(MODEL.chat)
|
8 |
with gr.Row():
|
9 |
+
input_tokens = gr.Textbox(value=0, label='Input Tokens')
|
10 |
+
output_tokens = gr.Textbox(value=0, label='Output Tokens')
|
11 |
with gr.Column():
|
12 |
btn = gr.Button("Reset")
|
13 |
count_tokens = gr.Button('Count Tokens')
|
14 |
+
btn.click(MODEL.reset, outputs=[output_tokens, input_tokens])
|
15 |
+
count_tokens.click(MODEL.get_tokens, outputs=[input_tokens, output_tokens])
|
16 |
|
17 |
demo.launch(share=True)
|