我正在使用LangChain的HuggingFaceEmbedding和ConversationalRetrivalChain在Gema-2B-It模型上实现RAG.
运行时:
chat_history = []
question = "My prompt"
result = qa.invoke({"question": question, "chat_history": chat_history})
我得到
276
277 if self.pipeline.task == "text-generation":
--> 278 text = response["generated_text"]
279 elif self.pipeline.task == "text2text-generation":
280 text = response["generated_text"]
KeyError: 'generated_text'
我不明白为什么会这样.它曾经工作过,今天,它只是停止工作.我也try 使用qa.run
而不是invoke
,但它仍然引发了相同的异常.
我try 过更换型号和设备,但都无法修复.