joaco7172 commited on
Commit
d360824
·
verified ·
1 Parent(s): 52f1cd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -193,7 +193,6 @@ def get_current_basics(symbol, curday):
193
 
194
 
195
  def get_all_prompts_online(symbol, data, curday, with_basics=True):
196
-
197
  company_prompt = get_company_prompt(symbol)
198
 
199
  prev_rows = []
@@ -206,8 +205,8 @@ def get_all_prompts_online(symbol, data, curday, with_basics=True):
206
  for i in range(-len(prev_rows), 0):
207
  prompt += "\n" + prev_rows[i][0]
208
  latest_news_items = latest_news(
209
- prev_rows[i][1],
210
- min(5, len(prev_rows[i][1]))
211
  )
212
  if latest_news_items:
213
  prompt += "\n".join(latest_news_items)
@@ -265,7 +264,7 @@ def predict(ticker, date, n_weeks, use_basics):
265
  print("Inputs loaded onto devices.")
266
 
267
  res = model.generate(
268
- **inputs, max_length=4096, do_sample=True,
269
  eos_token_id=tokenizer.eos_token_id,
270
  use_cache=True, streamer=streamer
271
  )
@@ -312,13 +311,8 @@ demo = gr.Interface(
312
  label="Response"
313
  )
314
  ],
315
- title="FinGPT-Forecaster",
316
- description="""FinGPT-Forecaster takes random market news and optional basic financials related to the specified company from the past few weeks as input and responds with the company's **positive developments** and **potential concerns**. Then it gives out a **prediction** of stock price movement for the coming week and its **analysis** summary.
317
- This model is finetuned on Llama2-7b-chat-hf with LoRA on the past year's DOW30 market data. Inference in this demo uses fp16 and **welcomes any ticker symbol**.
318
- Company profile & Market news & Basic financials & Stock prices are retrieved using **yfinance & finnhub**.
319
- This is just a demo showing what this model is capable of. Results inferred from randomly chosen news can be strongly biased.
320
- For more detailed and customized implementation, refer to our FinGPT project: <https://github.com/AI4Finance-Foundation/FinGPT>
321
- **Disclaimer: Nothing herein is financial advice, and NOT a recommendation to trade real money. Please use common sense and always first consult a professional before trading or investing.**
322
  """
323
  )
324
 
 
193
 
194
 
195
  def get_all_prompts_online(symbol, data, curday, with_basics=True):
 
196
  company_prompt = get_company_prompt(symbol)
197
 
198
  prev_rows = []
 
205
  for i in range(-len(prev_rows), 0):
206
  prompt += "\n" + prev_rows[i][0]
207
  latest_news_items = latest_news(
208
+ json.loads(prev_rows[i][1]),
209
+ min(5, len(json.loads(prev_rows[i][1])))
210
  )
211
  if latest_news_items:
212
  prompt += "\n".join(latest_news_items)
 
264
  print("Inputs loaded onto devices.")
265
 
266
  res = model.generate(
267
+ **inputs, max_length=4096, do_sample=False,
268
  eos_token_id=tokenizer.eos_token_id,
269
  use_cache=True, streamer=streamer
270
  )
 
311
  label="Response"
312
  )
313
  ],
314
+ title="Pro Capital",
315
+ description="""Pro Capital implementation.**
 
 
 
 
 
316
  """
317
  )
318