YixuanWang commited on
Commit
3bb8b12
·
verified ·
1 Parent(s): 6a49115

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -9,7 +9,10 @@ from huggingface_hub import login
9
 
10
  # Get the Hugging Face API token from the environment variable
11
  hf_token = os.getenv("pasavectoi")
12
- login(hf_token)
 
 
 
13
 
14
  # Load the dataset from the local file
15
  data = pd.read_csv('twitter_dataset.csv').head(1000)
 
9
 
10
  # Get the Hugging Face API token from the environment variable
11
  hf_token = os.getenv("pasavectoi")
12
+
13
+ # Login to Hugging Face Hub using the token without interactive prompt
14
+ api = HfApi()
15
+ api.set_access_token(hf_token)
16
 
17
  # Load the dataset from the local file
18
  data = pd.read_csv('twitter_dataset.csv').head(1000)