Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,16 @@ hf = HuggingFaceHubEmbeddings(
|
|
| 16 |
huggingfacehub_api_token= token,
|
| 17 |
)
|
| 18 |
|
| 19 |
-
from langchain.embeddings import HuggingFaceInferenceAPIEmbeddings
|
| 20 |
|
| 21 |
-
embeddings = HuggingFaceInferenceAPIEmbeddings(
|
| 22 |
-
|
| 23 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def main():
|
|
@@ -52,7 +57,7 @@ def main():
|
|
| 52 |
# embeddings = query(chunks)
|
| 53 |
# embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
| 54 |
|
| 55 |
-
knowledge_base = FAISS.from_texts(chunks,
|
| 56 |
|
| 57 |
# show user input
|
| 58 |
user_question = st.text_input("Ask a question about your PDF:")
|
|
|
|
| 16 |
huggingfacehub_api_token= token,
|
| 17 |
)
|
| 18 |
|
| 19 |
+
# from langchain.embeddings import HuggingFaceInferenceAPIEmbeddings
|
| 20 |
|
| 21 |
+
# embeddings = HuggingFaceInferenceAPIEmbeddings(
|
| 22 |
+
# api_key=token, model_name="sentence-transformers/all-MiniLM-l6-v2"
|
| 23 |
+
# )
|
| 24 |
+
# hf = HuggingFaceHubEmbeddings(
|
| 25 |
+
# repo_id=repo_id,
|
| 26 |
+
# task="feature-extraction",
|
| 27 |
+
# huggingfacehub_api_token= HUGGINGFACEHUB_API_TOKEN,
|
| 28 |
+
# )
|
| 29 |
|
| 30 |
|
| 31 |
def main():
|
|
|
|
| 57 |
# embeddings = query(chunks)
|
| 58 |
# embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
| 59 |
|
| 60 |
+
knowledge_base = FAISS.from_texts(chunks, hf)
|
| 61 |
|
| 62 |
# show user input
|
| 63 |
user_question = st.text_input("Ask a question about your PDF:")
|