Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,8 @@ from transformers import BertTokenizer, BertForSequenceClassification
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# Load model and tokenizer from local directory (same folder as app.py)
|
| 6 |
-
model = BertForSequenceClassification.from_pretrained("
|
| 7 |
-
tokenizer = BertTokenizer.from_pretrained("
|
| 8 |
|
| 9 |
# Ensure model runs on GPU if available
|
| 10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# Load model and tokenizer from local directory (same folder as app.py)
|
| 6 |
+
model = BertForSequenceClassification.from_pretrained("bert_expense_query_model_2", trust_remote_code = True)
|
| 7 |
+
tokenizer = BertTokenizer.from_pretrained("bert_expense_query_model_2")
|
| 8 |
|
| 9 |
# Ensure model runs on GPU if available
|
| 10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|