Spaces:
Runtime error
Runtime error
jonathanjordan21
commited on
Commit
•
3018c2c
1
Parent(s):
7076b24
Update custom_llm.py
Browse files- custom_llm.py +1 -1
custom_llm.py
CHANGED
@@ -153,7 +153,7 @@ def custom_chain_with_history(llm, memory):
|
|
153 |
# )
|
154 |
|
155 |
# return {"chat_history":prompt_memory, "context":asyncio.run(create_vectorstore()).as_retriever(search_type="similarity", search_kwargs={"k": 12}) | format_docs, "question": RunnablePassthrough()} | prompt | llm
|
156 |
-
return {"chat_history":lambda x:prompt_memory(x['memory']), "context":asyncio.run(create_vectorstore()).as_retriever(search_type="similarity", search_kwargs={"k": 12}) | format_docs, "question": lambda x:x['question']} | prompt | llm
|
157 |
|
158 |
class CustomLLM(LLM):
|
159 |
repo_id : str
|
|
|
153 |
# )
|
154 |
|
155 |
# return {"chat_history":prompt_memory, "context":asyncio.run(create_vectorstore()).as_retriever(search_type="similarity", search_kwargs={"k": 12}) | format_docs, "question": RunnablePassthrough()} | prompt | llm
|
156 |
+
return {"chat_history":lambda x:prompt_memory(x['memory']), "context":itemgetter("question") | asyncio.run(create_vectorstore()).as_retriever(search_type="similarity", search_kwargs={"k": 12}) | format_docs, "question": lambda x:x['question']} | prompt | llm
|
157 |
|
158 |
class CustomLLM(LLM):
|
159 |
repo_id : str
|