Spaces:
Runtime error
Runtime error
LVKinyanjui
commited on
Commit
•
38013b3
1
Parent(s):
cfd39e4
Changed hf token permission from read to the required write
Browse files- app_inference.py +5 -3
app_inference.py
CHANGED
@@ -12,8 +12,7 @@ SYSTEM_MESSAGE = "You are a hepful, knowledgeable assistant"
|
|
12 |
# ENV VARS
|
13 |
# To avert Permision error with transformer and hf models
|
14 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = '.'
|
15 |
-
token = os.getenv("
|
16 |
-
|
17 |
# STREAMLIT UI AREA
|
18 |
|
19 |
st.write("## Ask your Local LLM")
|
@@ -22,7 +21,10 @@ submit = st.button("Submit")
|
|
22 |
|
23 |
# MODEL AREA
|
24 |
# Use the token to authenticate
|
25 |
-
login(token=token,
|
|
|
|
|
|
|
26 |
model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
|
27 |
|
28 |
@st.cache_resource
|
|
|
12 |
# ENV VARS
|
13 |
# To avert Permision error with transformer and hf models
|
14 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = '.'
|
15 |
+
token = os.getenv("HF_TOKEN_WRITE") # Must be a write token
|
|
|
16 |
# STREAMLIT UI AREA
|
17 |
|
18 |
st.write("## Ask your Local LLM")
|
|
|
21 |
|
22 |
# MODEL AREA
|
23 |
# Use the token to authenticate
|
24 |
+
login(token=token,
|
25 |
+
write_permission=True # Must be set to True when we pass in our own token
|
26 |
+
# Otherwise we get Permission Denied.
|
27 |
+
)
|
28 |
model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
|
29 |
|
30 |
@st.cache_resource
|