Spaces:
Sleeping
Sleeping
Update pages/1_Python.py
Browse files- pages/1_Python.py +2 -0
pages/1_Python.py
CHANGED
@@ -5,6 +5,8 @@ from langchain_core.messages import HumanMessage, SystemMessage
|
|
5 |
|
6 |
# Load HuggingFace token from environment variable
|
7 |
hf = os.getenv('Data_science')
|
|
|
|
|
8 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = hf
|
9 |
os.environ['HF_TOKEN'] = hf
|
10 |
|
|
|
5 |
|
6 |
# Load HuggingFace token from environment variable
|
7 |
hf = os.getenv('Data_science')
|
8 |
+
if hf is None:
|
9 |
+
raise ValueError("Hugging Face token not found. Please set the 'Data_science' environment variable.")
|
10 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = hf
|
11 |
os.environ['HF_TOKEN'] = hf
|
12 |
|