JCai commited on
Commit
949197a
1 Parent(s): eecd30c

Revert "Update app.py"

Browse files

This reverts commit 8c14a90a

Files changed (1) hide show
  1. app.py +22 -5
app.py CHANGED
@@ -194,13 +194,30 @@ ui_design = UI_design()
194
  with gr.Blocks(css=custom_css) as demo:
195
  gr.Markdown("<h1 style='text-align: center;'> 😸 Meowthamatical AI Chatbot 😸</h1>")
196
  gr.Markdown(" Interact with the AI chatbot using customizable settings below.")
197
- use_local_model = gr.Checkbox(label="Use Local Model", value=False)
198
 
199
  with gr.Row():
200
- system_message = gr.Textbox(value="You are a cat and you love talking about and teaching math.",
201
- label="System message",
202
- interactive=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  use_local_model = gr.Checkbox(label="Use Local Model", value=False)
 
 
 
 
 
204
 
205
  chat_history = gr.Chatbot(label="Chat")
206
 
@@ -209,7 +226,7 @@ with gr.Blocks(css=custom_css) as demo:
209
  cancel_button = gr.Button("Cancel Inference", variant="danger")
210
 
211
  # Adjusted to ensure history is maintained and passed correctly
212
- user_input.submit(respond, [user_input, chat_history, use_local_model], chat_history)
213
 
214
  cancel_button.click(cancel_inference)
215
 
 
194
  with gr.Blocks(css=custom_css) as demo:
195
  gr.Markdown("<h1 style='text-align: center;'> 😸 Meowthamatical AI Chatbot 😸</h1>")
196
  gr.Markdown(" Interact with the AI chatbot using customizable settings below.")
 
197
 
198
  with gr.Row():
199
+ with gr.Column():
200
+ with gr.Tabs() as input_tabs:
201
+ with gr.Tab("Sketch"):
202
+ input_sketchpad = gr.Sketchpad(type="pil", label="Sketch", layers=False)
203
+
204
+ input_text = gr.Textbox(label="input your question")
205
+
206
+ with gr.Row():
207
+ # with gr.Column():
208
+ # clear_btn = gr.ClearButton(
209
+ # [input_sketchpad, input_text])
210
+ with gr.Column():
211
+ submit_btn = gr.Button("Submit", variant="primary")
212
+
213
+ with gr.Row():
214
+ system_message = gr.Textbox(value="You are not a friendly Chatbot.", label="System message", interactive=True)
215
  use_local_model = gr.Checkbox(label="Use Local Model", value=False)
216
+ button_1 = gr.Button("Submit", variant="primary")
217
+ with gr.Row():
218
+ max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
219
+ temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
220
+ top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
221
 
222
  chat_history = gr.Chatbot(label="Chat")
223
 
 
226
  cancel_button = gr.Button("Cancel Inference", variant="danger")
227
 
228
  # Adjusted to ensure history is maintained and passed correctly
229
+ user_input.submit(respond, [user_input, chat_history, system_message, max_tokens, temperature, top_p, use_local_model], chat_history)
230
 
231
  cancel_button.click(cancel_inference)
232