Skip to content
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

Memory is not getting stored in conversation flows in streamlit app #2

Open
anushkayadav opened this issue Mar 15, 2023 · 2 comments
Open

Comments

@anushkayadav
Copy link

Screenshot 2023-03-15 at 9 30 06 PM

Verbose output

Screenshot 2023-03-15 at 9 30 49 PM

The history is not getting saved.
I defined the chain as follows

chain = ConversationChain(llm=llm,
                              verbose=True,
                              memory=ConversationBufferMemory())

I also tried using prompts and LLM chain

#prompt= prompt definition here
prompt = PromptTemplate(
    input_variables=["history", "human_input"], 
    template=template
)

chatgpt_chain = LLMChain(
    llm=llm, 
    prompt=prompt, 
    verbose=True, 
    memory=ConversationBufferWindowMemory(k=4),
)

output = chatgpt_chain.predict(human_input="Hello")

All of this works fine on notebooks but in streamlit app, the history is not getting passes in prompt

@samdobson
Copy link

Hey. I made a PR with a suggested approach to ensuring memory persists between messages: take a look at #1

@anushkayadav
Copy link
Author

@samdobson This works! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants