Spaces:
Runtime error
Runtime error
Allow for the financial basics button
Browse files
app.py
CHANGED
@@ -376,10 +376,10 @@ def get_all_prompts_online(symbol, with_basics=True, max_news_perweek = 3, weeks
|
|
376 |
return info, prompt
|
377 |
|
378 |
|
379 |
-
def ask(symbol, weeks_before):
|
380 |
|
381 |
# load inference data
|
382 |
-
info, pt = get_all_prompts_online(symbol=symbol, weeks_before=weeks_before)
|
383 |
# print(info)
|
384 |
|
385 |
inputs = tokenizer(pt, return_tensors='pt')
|
@@ -411,10 +411,15 @@ server = gr.Interface(
|
|
411 |
label="weeks_before",
|
412 |
info="Due to the token length constraint, you are recommended to input with 2"
|
413 |
),
|
|
|
|
|
|
|
|
|
|
|
414 |
],
|
415 |
outputs=[
|
416 |
gr.Textbox(
|
417 |
-
label="Information"
|
418 |
),
|
419 |
gr.Textbox(
|
420 |
label="Response"
|
@@ -423,6 +428,8 @@ server = gr.Interface(
|
|
423 |
title="FinGPT-Forecaster-Chinese",
|
424 |
description="""This version allows the prediction based on the most current date. We will upgrade it to allow customized date soon.
|
425 |
|
|
|
|
|
426 |
This demo has been downgraded to using T4 with 8-bit inference due to cost considerations, speed & performance may be affected.
|
427 |
|
428 |
**⚠️Warning**: This is just a demo showing what this model can do. During each individual inference, company news is randomly sampled from all the news from designated weeks, which might result in different predictions for the same period. We suggest users deploy the original model or clone this space and inference with more carefully selected news in their favorable ways.
|
|
|
376 |
return info, prompt
|
377 |
|
378 |
|
379 |
+
def ask(symbol, weeks_before, withbasic):
|
380 |
|
381 |
# load inference data
|
382 |
+
info, pt = get_all_prompts_online(symbol=symbol, weeks_before=weeks_before, with_basics=withbasic)
|
383 |
# print(info)
|
384 |
|
385 |
inputs = tokenizer(pt, return_tensors='pt')
|
|
|
411 |
label="weeks_before",
|
412 |
info="Due to the token length constraint, you are recommended to input with 2"
|
413 |
),
|
414 |
+
gr.Checkbox(
|
415 |
+
label="Use Latest Basic Financials",
|
416 |
+
value=True,
|
417 |
+
info="If checked, the latest quarterly reported basic financials of the company is taken into account."
|
418 |
+
)
|
419 |
],
|
420 |
outputs=[
|
421 |
gr.Textbox(
|
422 |
+
label="Information Provided"
|
423 |
),
|
424 |
gr.Textbox(
|
425 |
label="Response"
|
|
|
428 |
title="FinGPT-Forecaster-Chinese",
|
429 |
description="""This version allows the prediction based on the most current date. We will upgrade it to allow customized date soon.
|
430 |
|
431 |
+
**The estimated time cost is 180s**
|
432 |
+
|
433 |
This demo has been downgraded to using T4 with 8-bit inference due to cost considerations, speed & performance may be affected.
|
434 |
|
435 |
**⚠️Warning**: This is just a demo showing what this model can do. During each individual inference, company news is randomly sampled from all the news from designated weeks, which might result in different predictions for the same period. We suggest users deploy the original model or clone this space and inference with more carefully selected news in their favorable ways.
|