Spaces:
Build error
Build error
Download Components/OpenAIChat.py from waloneai/Resume-filter-plus-QA-documents: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/waloneai/Resume-filter-plus-QA-documents/resolve/main/Components/OpenAIChat.py
- Command line
-
hf download hf://spaces/waloneai/Resume-filter-plus-QA-documents/Components/OpenAIChat.py
-
curl -L -o OpenAIChat.py https://huggingface.co/spaces/waloneai/Resume-filter-plus-QA-documents/resolve/main/Components/OpenAIChat.py
825 Bytes
| # def handle_user_input(question): | |
| # response = st.session_state.conversation({'question':question}) | |
| # st.session_state.chat_history = response('chat_history') | |
| # for i,message in enumerate(st.session_state.chat_history): | |
| # if i % 2 == 0: | |
| # st.write(user_template.replace("{{MSG}}",message.content),unsafe_allow_html=True) | |
| # else: | |
| # st.write(bot_template.replace("{{MSG}}",message.content),unsafe_allow_html=True) | |
| # def get_conversation_chain(vector_store): | |
| # llm = ChatOpenAI() | |
| # memory = ConversationBufferMemory(memory_key='chat_history', return_messages=True) | |
| # conversation_chain = ConversationalRetrievalChain.from_llm( | |
| # llm=llm, | |
| # retriever=vector_store.as_retriever(), | |
| # memory = memory | |
| # ) | |
| # return conversation_chain |