Skip to content

Commit

Permalink
Fix embeddings config errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarhane committed Oct 4, 2023
1 parent 6e9d813 commit cc9f75c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# if Neo4j is local, you can go to http://localhost:7474/ to browse the database
neo4j_graph = Neo4jGraph(url=url, username=username, password=password)
embeddings, dimension = load_embedding_model(
embedding_model_name, config={ollama_base_url: ollama_base_url}, logger=logger
embedding_model_name, config={"ollama_base_url": ollama_base_url}, logger=logger
)
create_vector_index(neo4j_graph, dimension)

Expand Down
4 changes: 3 additions & 1 deletion chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

def load_embedding_model(embedding_model_name: str, logger=BaseLogger(), config={}):
if embedding_model_name == "ollama":
embeddings = OllamaEmbeddings(base_url=config.ollama_base_url, model="llama2")
embeddings = OllamaEmbeddings(
base_url=config["ollama_base_url"], model="llama2"
)
dimension = 4096
logger.info("Embedding: Using Ollama")
elif embedding_model_name == "openai":
Expand Down
2 changes: 1 addition & 1 deletion loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
so_api_base_url = "https://api.stackexchange.com/2.3/search/advanced"

embeddings, dimension = load_embedding_model(
embedding_model_name, config={ollama_base_url: ollama_base_url}, logger=logger
embedding_model_name, config={"ollama_base_url": ollama_base_url}, logger=logger
)

# if Neo4j is local, you can go to http://localhost:7474/ to browse the database
Expand Down
2 changes: 1 addition & 1 deletion pdf_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


embeddings, dimension = load_embedding_model(
embedding_model_name, config={ollama_base_url: ollama_base_url}, logger=logger
embedding_model_name, config={"ollama_base_url": ollama_base_url}, logger=logger
)


Expand Down

0 comments on commit cc9f75c

Please sign in to comment.