mohitrajdeo
commited on
Commit
·
c12b87a
1
Parent(s):
2f83400
chore: add Hugging Face token login for model access
Browse filesEnable secure access to Hugging Face models by logging in with the HF_TOKEN environment variable. This ensures proper authentication when loading the model for mental analysis.
app.py
CHANGED
@@ -637,7 +637,10 @@ if selected == 'Data Visualization':
|
|
637 |
import torch
|
638 |
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
|
639 |
|
|
|
|
|
640 |
|
|
|
641 |
|
642 |
if selected == "Mental-Analysis":
|
643 |
# Load the Hugging Face model
|
|
|
637 |
import torch
|
638 |
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
|
639 |
|
640 |
+
import os
|
641 |
+
from huggingface_hub import login
|
642 |
|
643 |
+
login(token=os.environ.get("HF_TOKEN"))
|
644 |
|
645 |
if selected == "Mental-Analysis":
|
646 |
# Load the Hugging Face model
|