Akhil4839 commited on
Commit
daf7d4b
·
verified ·
1 Parent(s): 361b3c0

Update pages/1_Python.py

Browse files
Files changed (1) hide show
  1. 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