AIAnytime / AIAnytime/Llama2-Medical-Chatbot

I get double output if i use this code, dont know how to fix this?

未關閉
#13 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
355
分支
240
PR 合併指標
30 天內沒有已合併 PR

描述

![image](https://github.com/AIAnytime/Llama2-Medical-Chatbot/assets/37467725/3c6c9453-756f-4fd6-b34e-628e1237cfed)

This is the code copied from your repo :

@cl.on_chat_start
async def start():
chain = qa_bot()
msg = cl.Message(content="Starting the bot...")
await msg.send()
msg.content = "Hi, Welcome to School Assist Bot. What is your query?"
await msg.update()

cl.user_session.set("chain", chain)

@cl.on_message
async def main(message):
chain = cl.user_session.get("chain")
cb = cl.AsyncLangchainCallbackHandler(
stream_final_answer=True, answer_prefix_tokens=["FINAL", "ANSWER"]
)
cb.answer_reached = True
res = await chain.acall(message, callbacks=[cb])
answer = res["result"]
print(answer)
#sources = res["source_documents"]

# if sources:
# answer += f"\nSources:" + str(sources)
# #pass
# else:
# answer += "\nNo sources found"

await cl.Message(content=answer).send()

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。