Spaces:
Sleeping
Sleeping
Adding working cached examples, and textbox for output UI component
Browse files
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?", "
|
288 |
["Summarize the Management Discussion and Analysis section of the 2021 report in 50 words.", ""],
|
289 |
-
["What was the company's debt level in
|
290 |
-
["
|
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
|