m96tkmok commited on
Commit
88ec983
·
verified ·
1 Parent(s): 1b7db4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,8 @@ from langchain_community.document_loaders import PyPDFLoader
9
 
10
  from langchain_text_splitters import RecursiveCharacterTextSplitter
11
 
12
- from langchain_ollama import OllamaEmbeddings
 
13
 
14
  import faiss
15
  from langchain_community.vectorstores import FAISS
@@ -19,7 +20,6 @@ from langchain import hub
19
  from langchain_core.output_parsers import StrOutputParser
20
  from langchain_core.runnables import RunnablePassthrough
21
  from langchain_core.prompts import ChatPromptTemplate
22
- from langchain_cohere import CohereEmbeddings
23
 
24
  from typing import List, Tuple, Dict, Any, Optional
25
 
@@ -101,8 +101,8 @@ def main() -> None:
101
 
102
  chunks = text_splitter.split_documents(raw_text)
103
 
104
- #embeddings = OllamaEmbeddings(model='nomic-ai/nomic-embed-text-v1.5', base_url="http://localhost:11434")
105
- embeddings = OllamaEmbeddings(model='nomic-embed-text', base_url="http://ollama:11434")
106
 
107
  single_vector = embeddings.embed_query("this is some text data")
108
 
 
9
 
10
  from langchain_text_splitters import RecursiveCharacterTextSplitter
11
 
12
+ #from langchain_ollama import OllamaEmbeddings
13
+ from langchain.embeddings import HuggingFaceEmbeddings
14
 
15
  import faiss
16
  from langchain_community.vectorstores import FAISS
 
20
  from langchain_core.output_parsers import StrOutputParser
21
  from langchain_core.runnables import RunnablePassthrough
22
  from langchain_core.prompts import ChatPromptTemplate
 
23
 
24
  from typing import List, Tuple, Dict, Any, Optional
25
 
 
101
 
102
  chunks = text_splitter.split_documents(raw_text)
103
 
104
+ #embeddings = OllamaEmbeddings(model='nomic-embed-text', base_url="http://localhost:11434")
105
+ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
106
 
107
  single_vector = embeddings.embed_query("this is some text data")
108