Spaces:
Sleeping
Sleeping
John Graham Reynolds
commited on
Commit
·
e49ec86
1
Parent(s):
4dd1424
add missing return statement
Browse files
chain.py
CHANGED
@@ -45,6 +45,7 @@ class ChainBuilder:
|
|
45 |
def load_and_cache_embedding_model(model_name):
|
46 |
embeddings = HuggingFaceEmbeddings(model_name=model_name, cache_folder="./langchain_cache/") # this cache isnt working because were in the Docker container
|
47 |
# update this to read from a presaved cache of bge-large
|
|
|
48 |
|
49 |
return load_and_cache_embedding_model(model_name)
|
50 |
|
@@ -66,7 +67,7 @@ class ChainBuilder:
|
|
66 |
columns=["name", "description"],
|
67 |
).as_retriever(search_kwargs=search_kwargs)
|
68 |
|
69 |
-
return vector_search_as_retriever
|
70 |
|
71 |
return get_and_cache_retriever(endpoint, index_name, embeddings, search_kwargs)
|
72 |
|
@@ -104,7 +105,7 @@ class ChainBuilder:
|
|
104 |
("user", "{question}"),
|
105 |
]
|
106 |
)
|
107 |
-
return prompt
|
108 |
|
109 |
# Format the converastion history to fit into the prompt template above.
|
110 |
# **** TODO after only a few statements this will likely overflow the context window
|
@@ -145,7 +146,7 @@ class ChainBuilder:
|
|
145 |
endpoint=endpoint,
|
146 |
extra_params=extra_params,
|
147 |
)
|
148 |
-
return model
|
149 |
|
150 |
return get_and_cache_model(endpoint, extra_params)
|
151 |
|
|
|
45 |
def load_and_cache_embedding_model(model_name):
|
46 |
embeddings = HuggingFaceEmbeddings(model_name=model_name, cache_folder="./langchain_cache/") # this cache isnt working because were in the Docker container
|
47 |
# update this to read from a presaved cache of bge-large
|
48 |
+
return embeddings # return directly?
|
49 |
|
50 |
return load_and_cache_embedding_model(model_name)
|
51 |
|
|
|
67 |
columns=["name", "description"],
|
68 |
).as_retriever(search_kwargs=search_kwargs)
|
69 |
|
70 |
+
return vector_search_as_retriever # return directly?
|
71 |
|
72 |
return get_and_cache_retriever(endpoint, index_name, embeddings, search_kwargs)
|
73 |
|
|
|
105 |
("user", "{question}"),
|
106 |
]
|
107 |
)
|
108 |
+
return prompt # return directly?
|
109 |
|
110 |
# Format the converastion history to fit into the prompt template above.
|
111 |
# **** TODO after only a few statements this will likely overflow the context window
|
|
|
146 |
endpoint=endpoint,
|
147 |
extra_params=extra_params,
|
148 |
)
|
149 |
+
return model # return directly?
|
150 |
|
151 |
return get_and_cache_model(endpoint, extra_params)
|
152 |
|