added HF_Login
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ print(f"Loading FAISS index from: {embedding_path}")
|
|
7 |
if not os.path.exists(embedding_path):
|
8 |
print("File not found!")
|
9 |
|
|
|
|
|
10 |
import spaces
|
11 |
import sys
|
12 |
import time
|
@@ -26,6 +28,9 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
26 |
from langchain_community.vectorstores.utils import DistanceStrategy
|
27 |
from sentence_transformers import SentenceTransformer
|
28 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextIteratorStreamer, pipeline
|
|
|
|
|
|
|
29 |
|
30 |
class BSIChatbot:
|
31 |
def __init__(self, model_paths: Dict[str, str], docs_path: str):
|
|
|
7 |
if not os.path.exists(embedding_path):
|
8 |
print("File not found!")
|
9 |
|
10 |
+
HF_KEY=os.getenv('Gated_Repo')
|
11 |
+
|
12 |
import spaces
|
13 |
import sys
|
14 |
import time
|
|
|
28 |
from langchain_community.vectorstores.utils import DistanceStrategy
|
29 |
from sentence_transformers import SentenceTransformer
|
30 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextIteratorStreamer, pipeline
|
31 |
+
from huggingface_hub import login
|
32 |
+
|
33 |
+
login(token=HF_KEY)
|
34 |
|
35 |
class BSIChatbot:
|
36 |
def __init__(self, model_paths: Dict[str, str], docs_path: str):
|