Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from torch.utils.data import Dataset, DataLoader
|
|
7 |
# Config class
|
8 |
class Config:
|
9 |
BERT_PATH = "ahmedrachid/FinancialBERT"
|
10 |
-
MODEL_PATH = "
|
11 |
TRAIN_BATCH_SIZE = 32
|
12 |
VALID_BATCH_SIZE = 32
|
13 |
EPOCHS = 10
|
@@ -18,7 +18,7 @@ class Config:
|
|
18 |
class FinancialBERT(nn.Module):
|
19 |
def __init__(self):
|
20 |
super(FinancialBERT, self).__init__()
|
21 |
-
self.bert = BertForSequenceClassification.from_pretrained(Config.BERT_PATH, num_labels=3, hidden_dropout_prob=0.
|
22 |
|
23 |
def forward(self, input_ids, attention_mask, token_type_ids=None, labels=None):
|
24 |
output = self.bert(input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids, labels=labels)
|
|
|
7 |
# Config class
|
8 |
class Config:
|
9 |
BERT_PATH = "ahmedrachid/FinancialBERT"
|
10 |
+
MODEL_PATH = "Sandy0909/finance_sentiment"
|
11 |
TRAIN_BATCH_SIZE = 32
|
12 |
VALID_BATCH_SIZE = 32
|
13 |
EPOCHS = 10
|
|
|
18 |
class FinancialBERT(nn.Module):
|
19 |
def __init__(self):
|
20 |
super(FinancialBERT, self).__init__()
|
21 |
+
self.bert = BertForSequenceClassification.from_pretrained(Config.BERT_PATH, num_labels=3, hidden_dropout_prob=0.3)
|
22 |
|
23 |
def forward(self, input_ids, attention_mask, token_type_ids=None, labels=None):
|
24 |
output = self.bert(input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids, labels=labels)
|