From a8897559ac508e8505e5853efe92571b598db715 Mon Sep 17 00:00:00 2001 From: Harsh Vasisht <50546771+HarshVasisht@users.noreply.github.com> Date: Wed, 5 Jul 2023 15:46:18 +0530 Subject: [PATCH] langchain_factory requires async --- app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 0b6a23d..170a4ca 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,5 @@ -import chainlit as cl - import os +import chainlit as cl huggingfacehub_api_token = os.environ['HUGGINGFACEHUB_API_TOKEN'] from langchain import HuggingFaceHub, PromptTemplate, LLMChain @@ -18,7 +17,7 @@ """ -@cl.langchain_factory +@cl.langchain_factory(use_async=True) def factory(): prompt = PromptTemplate(template=template, input_variables=["question"]) llm_chain = LLMChain(prompt=prompt, llm=llm, verbose=True)