Spaces:
Runtime error
Runtime error
change embedding model and file path for pdf
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ from ctransformers import AutoModelForCausalLM
|
|
| 17 |
|
| 18 |
# loading the embedding model -
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
print("embedding model loaded.............................")
|
| 23 |
print("####################################################")
|
|
@@ -60,7 +60,7 @@ def get_chunks(text):
|
|
| 60 |
return chunks
|
| 61 |
|
| 62 |
|
| 63 |
-
pdf_path = '
|
| 64 |
|
| 65 |
|
| 66 |
reader = PdfReader(pdf_path)
|
|
@@ -76,7 +76,7 @@ chunks = get_chunks(text)
|
|
| 76 |
print("Chunks are ready.....................................")
|
| 77 |
print("######################################################")
|
| 78 |
|
| 79 |
-
qdrant = QdrantClient(path = "
|
| 80 |
print("db created................................................")
|
| 81 |
print("#####################################################################")
|
| 82 |
|
|
|
|
| 17 |
|
| 18 |
# loading the embedding model -
|
| 19 |
|
| 20 |
+
model = SentenceTransformer('jinaai/jina-embedding-b-en-v1')
|
| 21 |
|
| 22 |
print("embedding model loaded.............................")
|
| 23 |
print("####################################################")
|
|
|
|
| 60 |
return chunks
|
| 61 |
|
| 62 |
|
| 63 |
+
pdf_path = './100 Weird Facts About the Human Body.pdf'
|
| 64 |
|
| 65 |
|
| 66 |
reader = PdfReader(pdf_path)
|
|
|
|
| 76 |
print("Chunks are ready.....................................")
|
| 77 |
print("######################################################")
|
| 78 |
|
| 79 |
+
qdrant = QdrantClient(path = "./db")
|
| 80 |
print("db created................................................")
|
| 81 |
print("#####################################################################")
|
| 82 |
|