Spaces:
Runtime error
Runtime error
pri2k
commited on
Commit
Β·
f6216bb
1
Parent(s):
0774891
π§ Updated app.py to compute embeddings using MentalBERT - 2
Browse files
app.py
CHANGED
|
@@ -12,8 +12,9 @@ if not HF_TOKEN:
|
|
| 12 |
raise ValueError("β Hugging Face API token not found! Set HF_TOKEN as an environment variable.")
|
| 13 |
|
| 14 |
# Load tokenizer and model
|
| 15 |
-
tokenizer = AutoTokenizer.from_pretrained("mental/mental-bert-base-uncased",
|
| 16 |
-
model = AutoModel.from_pretrained("mental/mental-bert-base-uncased",
|
|
|
|
| 17 |
model.eval() # Set model to evaluation mode
|
| 18 |
|
| 19 |
# Request body schema
|
|
|
|
| 12 |
raise ValueError("β Hugging Face API token not found! Set HF_TOKEN as an environment variable.")
|
| 13 |
|
| 14 |
# Load tokenizer and model
|
| 15 |
+
tokenizer = AutoTokenizer.from_pretrained("mental/mental-bert-base-uncased", use_auth_token=HF_TOKEN)
|
| 16 |
+
model = AutoModel.from_pretrained("mental/mental-bert-base-uncased", use_auth_token=HF_TOKEN)
|
| 17 |
+
|
| 18 |
model.eval() # Set model to evaluation mode
|
| 19 |
|
| 20 |
# Request body schema
|