Skip to content

update embedding model #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions 07 ollama RAG/main.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from langchain_community.embeddings import OllamaEmbeddings
from langchain_community.chat_models import ChatOllama
from langchain_ollama import OllamaEmbeddings
from langchain_ollama import ChatOllama
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain.text_splitter import RecursiveCharacterTextSplitter
import chromadb

# Initialize the embedding model
embed_model = OllamaEmbeddings(model="mistral")
embed_model = OllamaEmbeddings(model="nomic-embed-text")

# Path to the markdown file
file_path = "./data/product.md"
file_path = "./testdata/product.md"

# Function to read the content of the file
def load_file_content(file_path):
Expand Down Expand Up @@ -74,6 +74,6 @@ def answer_question(question):
return generation

# Example usage
question = "What does the product look liked?"
answer = answer_question(question)
print(f"Answer: {answer}")

print(f"Answer: {answer_question("What does the product look like?")}")
#print(f"Answer: {answer_question("What is the combat like?")}")