subhannadeem1 commited on
Commit
afeeb8e
·
1 Parent(s): c6b6f34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import torch
2
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
  import yfinance as yf
4
  import gradio as gr
5
 
6
- # Replace "your_model_name" with the actual name of the pre-trained model you want to use
7
- model_name = "your_model_name"
8
- tokenizer = AutoTokenizer.from_pretrained(model_name)
9
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
10
 
11
  def predict_stock_price(day, month, year, input_text):
12
  # Get the stock symbol from the input text
 
1
  import torch
2
+ from transformers import FinBERTTokenizer, FinBERTForSequenceClassification
3
  import yfinance as yf
4
  import gradio as gr
5
 
6
+ # Load the FinBERT tokenizer and model
7
+ tokenizer = FinBERTTokenizer.from_pretrained('yiyanghkust/finbert-tone', model_name_or_path='yiyanghkust/finbert-tone')
8
+ model = FinBERTForSequenceClassification.from_pretrained('yiyanghkust/finbert-tone', model_name_or_path='yiyanghkust/finbert-tone')
 
9
 
10
  def predict_stock_price(day, month, year, input_text):
11
  # Get the stock symbol from the input text