AIAnytime / AIAnytime/Llama2-Medical-Chatbot
I get double output if i use this code, dont know how to fix this?
- Lenguaje dominante
- Python
- Estrellas
- 355
- Forks
- 240
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción

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()
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.