Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -475,7 +475,7 @@ chain = ConversationalRetrievalChain.from_llm(
|
|
475 |
LLM_provider="Google",api_key=HF_key,temperature=0.1,
|
476 |
model_name="gemini-pro"),
|
477 |
memory=create_memory("gemini-pro"),
|
478 |
-
retriever =
|
479 |
llm=instantiate_LLM(
|
480 |
LLM_provider="Google",api_key=HF_key,temperature=0.5,
|
481 |
model_name="gemini-pro"),
|
@@ -486,6 +486,19 @@ chain = ConversationalRetrievalChain.from_llm(
|
|
486 |
|
487 |
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
# 1. load memory using RunnableLambda. Retrieves the chat_history attribute using itemgetter.
|
490 |
# `RunnablePassthrough.assign` adds the chat_history to the assign function
|
491 |
|
@@ -525,6 +538,9 @@ memory.save_context(
|
|
525 |
{"question": "What does DTC stand for?"},
|
526 |
{"answer": "Diffuse to Choose."}
|
527 |
)
|
|
|
|
|
|
|
528 |
print("Chat history:\n",memory.load_memory_variables({}))
|
529 |
|
530 |
follow_up_question = "plaese give more details about it, including its use cases and implementation."
|
|
|
475 |
LLM_provider="Google",api_key=HF_key,temperature=0.1,
|
476 |
model_name="gemini-pro"),
|
477 |
memory=create_memory("gemini-pro"),
|
478 |
+
retriever = BaseRetriever,
|
479 |
llm=instantiate_LLM(
|
480 |
LLM_provider="Google",api_key=HF_key,temperature=0.5,
|
481 |
model_name="gemini-pro"),
|
|
|
486 |
|
487 |
|
488 |
|
489 |
+
# let's invoke the chain
|
490 |
+
response = chain.invoke({"question":"what does DTC stand for?"})
|
491 |
+
response
|
492 |
+
|
493 |
+
|
494 |
+
chain.memory.load_memory_variables({})
|
495 |
+
|
496 |
+
follow_up_question = "plaese give more details about it, including its use cases and implementation."
|
497 |
+
|
498 |
+
chain.invoke({"question":follow_up_question})['answer'])
|
499 |
+
|
500 |
+
|
501 |
+
"""
|
502 |
# 1. load memory using RunnableLambda. Retrieves the chat_history attribute using itemgetter.
|
503 |
# `RunnablePassthrough.assign` adds the chat_history to the assign function
|
504 |
|
|
|
538 |
{"question": "What does DTC stand for?"},
|
539 |
{"answer": "Diffuse to Choose."}
|
540 |
)
|
541 |
+
|
542 |
+
"""
|
543 |
+
|
544 |
print("Chat history:\n",memory.load_memory_variables({}))
|
545 |
|
546 |
follow_up_question = "plaese give more details about it, including its use cases and implementation."
|