Parcourir la source

更新提示词

服务器 il y a 8 mois
Parent
commit
8067b02393

BIN
__pycache__/embed.cpython-310.pyc


BIN
__pycache__/get_vector_db.cpython-310.pyc


BIN
__pycache__/query.cpython-310.pyc


+ 0 - 0
chroma/cd7cb5a8-0622-4833-a6a2-d812be9d5da4/data_level0.bin → chroma/30506c58-ea7b-436d-8147-c6c8796f9fcb/data_level0.bin


+ 0 - 0
chroma/cd7cb5a8-0622-4833-a6a2-d812be9d5da4/header.bin → chroma/30506c58-ea7b-436d-8147-c6c8796f9fcb/header.bin


BIN
chroma/30506c58-ea7b-436d-8147-c6c8796f9fcb/length.bin


+ 0 - 0
chroma/cd7cb5a8-0622-4833-a6a2-d812be9d5da4/link_lists.bin → chroma/30506c58-ea7b-436d-8147-c6c8796f9fcb/link_lists.bin


BIN
chroma/cd7cb5a8-0622-4833-a6a2-d812be9d5da4/length.bin


BIN
chroma/chroma.sqlite3


+ 1 - 1
embed.py

@@ -27,7 +27,7 @@ def load_and_split_data(file_path):
     # Load the PDF file and split the data into chunks
     loader = UnstructuredPDFLoader(file_path=file_path)
     data = loader.load()
-    text_splitter = RecursiveCharacterTextSplitter(chunk_size=7500, chunk_overlap=100)
+    text_splitter = RecursiveCharacterTextSplitter(chunk_size=3000, chunk_overlap=100)
     chunks = text_splitter.split_documents(data)
 
     return chunks

+ 1 - 1
get_vector_db.py

@@ -7,7 +7,7 @@ COLLECTION_NAME = os.getenv('COLLECTION_NAME', 'siwei_ai')
 TEXT_EMBEDDING_MODEL = os.getenv('TEXT_EMBEDDING_MODEL', 'nomic-embed-text')
 
 def get_vector_db():
-    embedding = OllamaEmbeddings(model=TEXT_EMBEDDING_MODEL,show_progress=True,num_ctx=32000,num_gpu=0)
+    embedding = OllamaEmbeddings(model=TEXT_EMBEDDING_MODEL,show_progress=True,num_gpu=0)
 
     db = Chroma(
         collection_name=COLLECTION_NAME,

+ 1 - 1
query.py

@@ -34,7 +34,7 @@ def get_prompt():
 def query(input):
     if input:
         # Initialize the language model with the specified model name
-        llm = ChatOllama(model=LLM_MODEL,keep_alive=-1,num_ctx=32000,num_gpu=0)
+        llm = ChatOllama(model=LLM_MODEL,keep_alive=-1,num_gpu=0)
         # Get the vector database instance
         db = get_vector_db()
         # Get the prompt templates