AhmedSSabir
commited on
Commit
•
be87a75
1
Parent(s):
0558b8b
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ import numpy as np
|
|
14 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
15 |
#from torch.nn.functional import softmax
|
16 |
|
|
|
17 |
|
18 |
# just for the sake of this demo, we use cloze prob to initialize the hypothesis
|
19 |
|
@@ -55,11 +56,14 @@ def get_sim(x):
|
|
55 |
|
56 |
|
57 |
import os
|
58 |
-
print(os.getenv('HF_token'))
|
59 |
hf_api_token = os.getenv("HF_token") # For sensitive secrets
|
60 |
-
app_mode = os.getenv("APP_MODE") # For public variables
|
61 |
|
62 |
|
|
|
|
|
|
|
63 |
|
64 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
|
65 |
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B")
|
|
|
14 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
15 |
#from torch.nn.functional import softmax
|
16 |
|
17 |
+
from huggingface_hub import login
|
18 |
|
19 |
# just for the sake of this demo, we use cloze prob to initialize the hypothesis
|
20 |
|
|
|
56 |
|
57 |
|
58 |
import os
|
59 |
+
#print(os.getenv('HF_token'))
|
60 |
hf_api_token = os.getenv("HF_token") # For sensitive secrets
|
61 |
+
#app_mode = os.getenv("APP_MODE") # For public variables
|
62 |
|
63 |
|
64 |
+
access_token = hf_api_token
|
65 |
+
print(login(token = access_token))
|
66 |
+
|
67 |
|
68 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
|
69 |
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B")
|