Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ from sentence_transformers import SentenceTransformer
|
|
4 |
import faiss
|
5 |
import numpy as np
|
6 |
import pickle
|
7 |
-
from
|
8 |
-
from
|
9 |
import gradio as gr
|
10 |
|
11 |
# Initialize the embedding model
|
@@ -14,7 +14,7 @@ embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
|
14 |
# Initialize the HuggingFace LLM
|
15 |
llm = HuggingFaceEndpoint(
|
16 |
endpoint_url="https://api-inference.huggingface.co/models/gpt2",
|
17 |
-
|
18 |
)
|
19 |
|
20 |
# Initialize the HuggingFace embeddings
|
@@ -142,3 +142,4 @@ if __name__ == "__main__":
|
|
142 |
|
143 |
|
144 |
|
|
|
|
4 |
import faiss
|
5 |
import numpy as np
|
6 |
import pickle
|
7 |
+
from langchain.llms import HuggingFaceEndpoint
|
8 |
+
from langchain.embeddings import HuggingFaceEmbeddings
|
9 |
import gradio as gr
|
10 |
|
11 |
# Initialize the embedding model
|
|
|
14 |
# Initialize the HuggingFace LLM
|
15 |
llm = HuggingFaceEndpoint(
|
16 |
endpoint_url="https://api-inference.huggingface.co/models/gpt2",
|
17 |
+
api_key=os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
18 |
)
|
19 |
|
20 |
# Initialize the HuggingFace embeddings
|
|
|
142 |
|
143 |
|
144 |
|
145 |
+
|