Venusumo commited on
Commit
3c82043
·
verified ·
1 Parent(s): c65b57a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -48
app.py CHANGED
@@ -351,14 +351,6 @@ Contact Number
351
  04274525546
352
  """
353
 
354
- suggested_questions = [
355
- "What services do you offer?",
356
- "Can you tell me about your web development process?",
357
- "What is the cost for an e-commerce website?",
358
- "How long does it take to develop a custom website?",
359
- "Do you provide ongoing support and maintenance?",
360
- ]
361
-
362
  def respond(
363
  message,
364
  history: list[tuple[str, str]],
@@ -391,50 +383,25 @@ def respond(
391
  response += token
392
  yield response
393
 
394
- def set_suggested_question(question, textbox):
395
- textbox.value = question
396
-
397
  """
398
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
399
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
 
401
- demo = gr.Blocks()
402
-
403
- with demo:
404
- gr.Markdown("# Airavath Technologies Chatbot")
405
-
406
- with gr.Row():
407
- suggested_questions_dropdown = gr.Dropdown(
408
- choices=suggested_questions,
409
- label="Suggested Questions",
410
- interactive=True,
411
- )
412
-
413
- user_input = gr.Textbox(label="Your question here")
414
-
415
- set_question_button = gr.Button("Set Suggested Question")
416
-
417
- set_question_button.click(
418
- set_suggested_question,
419
- inputs=[suggested_questions_dropdown, user_input],
420
- outputs=[user_input],
421
- )
422
-
423
- gr.ChatInterface(
424
- respond,
425
- additional_inputs=[
426
- gr.Textbox(value=airavath_details, label="System message"),
427
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
428
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
429
- gr.Slider(
430
- minimum=0.1,
431
- maximum=1.0,
432
- value=0.95,
433
- step=0.05,
434
- label="Top-p (nucleus sampling)",
435
- ),
436
- ],
437
- )
438
 
439
  if __name__ == "__main__":
440
  demo.launch()
 
351
  04274525546
352
  """
353
 
 
 
 
 
 
 
 
 
354
  def respond(
355
  message,
356
  history: list[tuple[str, str]],
 
383
  response += token
384
  yield response
385
 
 
 
 
386
  """
387
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
388
  """
389
+ demo = gr.ChatInterface(
390
+ respond,
391
+ additional_inputs=[
392
+ gr.Textbox(value=airavath_details, label="System message"),
393
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
394
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
395
+ gr.Slider(
396
+ minimum=0.1,
397
+ maximum=1.0,
398
+ value=0.95,
399
+ step=0.05,
400
+ label="Top-p (nucleus sampling)",
401
+ ),
402
+ ],
403
+ )
404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
  if __name__ == "__main__":
407
  demo.launch()