vjain commited on
Commit
f2889c6
·
1 Parent(s): 62a1daa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -74,13 +74,20 @@ def reply(input, dataframe_name):
74
 
75
 
76
 
77
-
78
- input_text = gr.inputs.Textbox(label="Enter your questions here", placeholder="E.g. What is DNA?")
79
- text_output = gr.outputs.Textbox(label="Answer")
80
  csv_dropdown = gr.inputs.Dropdown(
81
  label="Select the Book",
82
- choices=["AP_Bio", "AP_Physics"]
 
 
 
 
 
 
 
 
83
  )
 
 
84
  description = "Scholar Bot is a question answering system designed to provide accurate and relevant answers to questions from this book hosted by OpenStax https://openstax.org/details/books/biology-ap-courses. Simply enter your question in the text box above and Scholar Bot will use advanced natural language processing algorithms to search a large corpus of biology text to find the best answer for you. Scholar Bot uses the Sentence Transformers model to generate embeddings of text, and OpenAI's GPT-3 language model to provide answers to your questions."
85
 
86
  ui = gr.Interface(fn=reply,
@@ -90,8 +97,7 @@ ui = gr.Interface(fn=reply,
90
  description=description,
91
  theme="light",
92
  layout="vertical",
93
- inputs_layout="stacked",
94
- outputs_layout="stacked",
95
  allow_flagging=False)
 
96
 
97
  ui.launch()
 
74
 
75
 
76
 
 
 
 
77
  csv_dropdown = gr.inputs.Dropdown(
78
  label="Select the Book",
79
+ choices=["AP_Bio", "AP_Physics",
80
+ default="AP_Bio"
81
+ ]
82
+ )
83
+ input_text = gr.inputs.Textbox(
84
+ label="Enter your questions here",
85
+ placeholder="E.g. What is DNA?".
86
+ lines=3,
87
+ maxlength=500
88
  )
89
+ text_output = gr.outputs.Textbox(label="Answer")
90
+
91
  description = "Scholar Bot is a question answering system designed to provide accurate and relevant answers to questions from this book hosted by OpenStax https://openstax.org/details/books/biology-ap-courses. Simply enter your question in the text box above and Scholar Bot will use advanced natural language processing algorithms to search a large corpus of biology text to find the best answer for you. Scholar Bot uses the Sentence Transformers model to generate embeddings of text, and OpenAI's GPT-3 language model to provide answers to your questions."
92
 
93
  ui = gr.Interface(fn=reply,
 
97
  description=description,
98
  theme="light",
99
  layout="vertical",
 
 
100
  allow_flagging=False)
101
+ examples=[["What is the function of DNA polymerase?", "AP_Bio"]]
102
 
103
  ui.launch()