chsubhasis commited on
Commit
f7c3d27
·
1 Parent(s): a21db6e

key addressed

Browse files
Files changed (2) hide show
  1. app.py +10 -1
  2. requirements.txt +0 -0
app.py CHANGED
@@ -14,8 +14,17 @@ from langchain.chains import RetrievalQA
14
  import numpy as np
15
  import gradio
16
  import sqlite3
 
 
 
 
 
 
 
 
 
 
17
 
18
- hfapi_key = getpass("Enter you HuggingFace access token:")
19
  os.environ["HF_TOKEN"] = hfapi_key
20
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = hfapi_key
21
 
 
14
  import numpy as np
15
  import gradio
16
  import sqlite3
17
+ from dotenv import load_dotenv
18
+
19
+ # Load environment variables
20
+ load_dotenv()
21
+
22
+ #hfapi_key = getpass("Enter you HuggingFace access token:")
23
+ hfapi_key = os.getenv("Mytoken")
24
+
25
+ if not hfapi_key:
26
+ raise ValueError("HUGGINGFACE_API_KEY not found in environment variables")
27
 
 
28
  os.environ["HF_TOKEN"] = hfapi_key
29
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = hfapi_key
30
 
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ