You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
model_name = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
Function to set up the conversational retrieval chain
def get_conversation_chain(vectorstore):
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, load_in_8bit=False,
device_map="cpu",
trust_remote_code=True)
model_path = "model_checkpoints/checkpoint-876"
peft_model = PeftModel.from_pretrained(model, model_path, from_transformers=True, device_map="cpu")
model = peft_model.merge_and_unload()
memory = ConversationBufferMemory(
memory_key='chat_history', return_messages=True
)
conversation_chain = ConversationalRetrievalChain.from_llm(
llm=model,
retriever=vectorstore.as_retriever(),
memory=memory
)
return conversation_chain
this error i got
ValidationError
pydantic.v1.error_wrappers.ValidationError: 2 validation errors for LLMChain
llm
instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)
llm
instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)
Beta Was this translation helpful? Give feedback.
All reactions