bubuuunel commited on
Commit
45f0fbc
1 Parent(s): 97b6d79

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -87,7 +87,7 @@ Here are some documents that are relevant to the question mentioned below.
87
  def predict(user_input,company):
88
  sample = {
89
  'user_input':user_input,
90
- 'company':company
91
  }
92
 
93
  filter = "dataset/"+company+"-10-k-2023.pdf"
@@ -122,7 +122,7 @@ def predict(user_input,company):
122
 
123
 
124
  # Get response from the LLM
125
- prediction = response.choices[0].message.content.strip()
126
 
127
  # While the prediction is made, log both the inputs and outputs to a local log file
128
  # While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
@@ -148,7 +148,7 @@ company_input = gr.Radio(
148
  label = 'company'
149
  )
150
 
151
- model_output = gr.Textbox (label = 'Response')
152
 
153
  # Add text box and radio button to the interface
154
  # The radio button is used to select the company 10k report in which the context needs to be retrieved.
@@ -161,7 +161,7 @@ model_output = gr.Textbox (label = 'Response')
161
  demo = gr.Interface(
162
  fn=predict,
163
  inputs=[user_input,company_input],
164
- outputs=prediction,
165
  title="RAG on 10k-reports",
166
  description="This API allows you to query on annaul reports",
167
  concurrency_limit=16
 
87
  def predict(user_input,company):
88
  sample = {
89
  'user_input':user_input,
90
+ 'company':company_input
91
  }
92
 
93
  filter = "dataset/"+company+"-10-k-2023.pdf"
 
122
 
123
 
124
  # Get response from the LLM
125
+
126
 
127
  # While the prediction is made, log both the inputs and outputs to a local log file
128
  # While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
 
148
  label = 'company'
149
  )
150
 
151
+ model_output = gr.label (label = 'Response')
152
 
153
  # Add text box and radio button to the interface
154
  # The radio button is used to select the company 10k report in which the context needs to be retrieved.
 
161
  demo = gr.Interface(
162
  fn=predict,
163
  inputs=[user_input,company_input],
164
+ outputs=model_output,
165
  title="RAG on 10k-reports",
166
  description="This API allows you to query on annaul reports",
167
  concurrency_limit=16