epalvarez commited on
Commit
64a3045
·
verified ·
1 Parent(s): 8d0a45d

Adding working cached examples, and textbox for output UI component

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -270,9 +270,10 @@ def predict(user_input):
270
 
271
  # Set up UI components for input and output
272
  # Input components
273
- user_question_textbox = gr.Textbox(placeholder="Enter your query here", lines=6)
274
  # Output components
275
- model_prediction = "text"
 
276
  # model_prediction = gr.Label(label="Model prediction") # This produces large font (not appropriate UI component)
277
 
278
 
@@ -284,10 +285,10 @@ demo = gr.Interface(
284
  title = "Ask Me Anything (AMA) on Tesla 10-K statements",
285
  description= " This web API presents an interface to ask questions about the contents of the Tesla 10-K reports for the period 2019 - 2023.",
286
  article = "Note that questions that are not relevant to the Tesla 10-K report will not be answered.",
287
- examples=[["What was the total revenue of the company in 2022?", "$ 81.46 Billion"],
288
  ["Summarize the Management Discussion and Analysis section of the 2021 report in 50 words.", ""],
289
- ["What was the company's debt level in 2020?", ""],
290
- ["Identify 5 key risks identified in the 2019 10k report? Respond with bullet point summaries.", ""]
291
  ],
292
  allow_flagging="auto", # automatically push to the HuggingFace Dataset
293
  concurrency_limit = 16
 
270
 
271
  # Set up UI components for input and output
272
  # Input components
273
+ user_question_textbox = gr.Textbox(label="User question", placeholder="Enter your query here", lines=6)
274
  # Output components
275
+ # model_prediction = "text" # OK, works.
276
+ model_prediction = gr.Textbox(label="Model prediction", placeholder="Enter your query here", lines=6)
277
  # model_prediction = gr.Label(label="Model prediction") # This produces large font (not appropriate UI component)
278
 
279
 
 
285
  title = "Ask Me Anything (AMA) on Tesla 10-K statements",
286
  description= " This web API presents an interface to ask questions about the contents of the Tesla 10-K reports for the period 2019 - 2023.",
287
  article = "Note that questions that are not relevant to the Tesla 10-K report will not be answered.",
288
+ examples=[["What was the total revenue of the company in 2022?", ""],
289
  ["Summarize the Management Discussion and Analysis section of the 2021 report in 50 words.", ""],
290
+ ["What was the company's debt level in 2021?", ""],
291
+ ["What are the risks related to the company's ability to grow its business in 2023? Respond with bullet point summaries.", ""]
292
  ],
293
  allow_flagging="auto", # automatically push to the HuggingFace Dataset
294
  concurrency_limit = 16