CobaltZvc commited on
Commit
4f455b7
β€’
1 Parent(s): 7cdd214

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -6
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
- gr.Interface(fn=saab,
79
- inputs=["text","state"],
80
- outputs=["chatbot","state"],
81
- title="SSB Virtual Coaching",
82
- description="Ask your doubts to Col. sir! (Dev. Vishwesh V Bhat)").launch(share=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()