Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
from transformers import pipeline
|
4 |
-
import os
|
5 |
import urllib3
|
|
|
6 |
|
7 |
# Disable warnings
|
8 |
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
@@ -11,8 +11,8 @@ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
11 |
session = requests.Session()
|
12 |
session.verify = False # Disable SSL verification
|
13 |
|
14 |
-
# Load the token from
|
15 |
-
|
16 |
|
17 |
# Set up the text generation pipeline with the token
|
18 |
pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct",
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
from transformers import pipeline
|
|
|
4 |
import urllib3
|
5 |
+
import os
|
6 |
|
7 |
# Disable warnings
|
8 |
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
|
11 |
session = requests.Session()
|
12 |
session.verify = False # Disable SSL verification
|
13 |
|
14 |
+
# Load the token from Hugging Face secrets
|
15 |
+
HUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN", "") # Set the default to empty if not found
|
16 |
|
17 |
# Set up the text generation pipeline with the token
|
18 |
pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct",
|