Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,21 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
| 7 |
from langchain.vectorstores import FAISS
|
| 8 |
from langchain.embeddings import HuggingFaceEmbeddings
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Initialize Hugging Face InferenceClient
|
| 11 |
client = InferenceClient(
|
| 12 |
provider="novita",
|
| 13 |
-
api_key=
|
| 14 |
)
|
| 15 |
|
| 16 |
# Global vectorstore
|
|
|
|
| 7 |
from langchain.vectorstores import FAISS
|
| 8 |
from langchain.embeddings import HuggingFaceEmbeddings
|
| 9 |
|
| 10 |
+
import os
|
| 11 |
+
from huggingface_hub import InferenceClient
|
| 12 |
+
|
| 13 |
+
hf_tokens = os.environ.get("hf_token")
|
| 14 |
+
|
| 15 |
+
# client = InferenceClient(
|
| 16 |
+
# provider="novita",
|
| 17 |
+
# api_key=hf_tokens
|
| 18 |
+
# )
|
| 19 |
+
|
| 20 |
+
|
| 21 |
# Initialize Hugging Face InferenceClient
|
| 22 |
client = InferenceClient(
|
| 23 |
provider="novita",
|
| 24 |
+
api_key=hf_tokens #"hf_xxxxxxxxxxxxxxxxxxxxxxxxx" # Replace with your HF token
|
| 25 |
)
|
| 26 |
|
| 27 |
# Global vectorstore
|