Spaces:
Runtime error
Runtime error
Commit ·
afeeb8e
1
Parent(s): c6b6f34
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
import torch
|
| 2 |
-
from transformers import
|
| 3 |
import yfinance as yf
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 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
|