bhaskartripathi commited on
Commit
276ccc4
1 Parent(s): f4b8910

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -149,7 +149,10 @@ def question_answer(url, file, question, openAI_key, model):
149
 
150
  if url.strip() != '' and file != None:
151
  return '[ERROR]: Both URL and PDF is provided. Please provide only one (either URL or PDF).'
152
-
 
 
 
153
  if url.strip() != '':
154
  glob_url = url
155
  download_pdf(glob_url, 'corpus.pdf')
@@ -225,8 +228,8 @@ with gr.Blocks() as demo:
225
  gr.Markdown("<center><h4>OR<h4></center>")
226
  file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
227
  question = gr.Textbox(label='Enter your question here')
228
- #model = gr.Radio(['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613', 'text-davinci-003'], label='Select Model', default='gpt-3.5-turbo')
229
- model = gr.Dropdown(choices=['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613', 'text-davinci-003'], label='Select Model', default='gpt-3.5-turbo')
230
  btn = gr.Button(value='Submit')
231
  btn.style(full_width=True)
232
 
 
149
 
150
  if url.strip() != '' and file != None:
151
  return '[ERROR]: Both URL and PDF is provided. Please provide only one (either URL or PDF).'
152
+
153
+ if model is None:
154
+ return '[ERROR]: You have not selected any model. Please select an LLM model.'
155
+
156
  if url.strip() != '':
157
  glob_url = url
158
  download_pdf(glob_url, 'corpus.pdf')
 
228
  gr.Markdown("<center><h4>OR<h4></center>")
229
  file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
230
  question = gr.Textbox(label='Enter your question here')
231
+ model = gr.Radio(['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613', 'text-davinci-003'], label='Select Model', default='gpt-3.5-turbo')
232
+ #model = gr.Dropdown(choices=['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613', 'text-davinci-003'], label='Select Large Language Model', default='gpt-3.5-turbo')
233
  btn = gr.Button(value='Submit')
234
  btn.style(full_width=True)
235