# Pipeline cannot infer suitable model classes from: \<model\_name\>

**URL:** <https://discuss.huggingface.co/t/pipeline-cannot-infer-suitable-model-classes-from-model-name/42776>\
**Category:** 🤗Hub\
**Created:** [June 10, 2023, 4:35pm UTC](https://discuss.huggingface.co/t/pipeline-cannot-infer-suitable-model-classes-from-model-name/42776 "2023-06-10T16:35:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucas0](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@lucas0](https://discuss.huggingface.co/u/lucas0)\
**Post date:** [June 10, 2023, 4:35pm UTC](https://discuss.huggingface.co/t/pipeline-cannot-infer-suitable-model-classes-from-model-name/42776/1 "2023-06-10T16:35:19Z")

</div>

finetuned a model ([decapoda-research/llama-7b-hf · Hugging Face](https://huggingface.co/decapoda-research/llama-7b-hf)) using peft and lora and saved as [https://huggingface.co/lucas0/empath-llama-7b](https://huggingface.co/lucas0/empath-llama-7b). Now im getting `Pipeline cannot infer suitable model classes from` when trying to use it along with with langchain and chroma vectordb:

```auto
from langchain.embeddings import HuggingFaceHubEmbeddings
from langchain import PromptTemplate, HuggingFaceHub, LLMChain
from langchain.chains import RetrievalQA
from langchain.prompts import PromptTemplate
from langchain.vectorstores import Chroma

repo_id = "sentence-transformers/all-mpnet-base-v2"
embedder = HuggingFaceHubEmbeddings(
    repo_id=repo_id,
    task="feature-extraction",
    huggingfacehub_api_token="XXXXX",
)

embeddings = embedder.embed_documents(texts=comments)
docsearch = Chroma.from_texts(comments, embedder).as_retriever()
#docsearch = Chroma.from_documents(texts, embeddings)

#llm = HuggingFaceHub(repo_id='decapoda-research/llama-7b-hf', huggingfacehub_api_token='XXXXX')
llm = HuggingFaceHub(repo_id='lucas0/empath-llama-7b', huggingfacehub_api_token='XXXXX')
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=docsearch, return_source_documents=False)

q = input("input your query:")
result = qa.run(query=q)

print(result["result"])
#print(result["source_documents"])

```

is anyone able to tell me how to fix this? Is it an issue with the model card? I was facing issues with the lack of the config.json file and ended up just placing the same config.json as the model I used as base for the lora fine-tuning. Could that be the origin of the issue? If so, how to generate the correct config.json without having to get the original llama weights?

Also, is there a way of loading several sentences into a custom HF model (not only OpenAi, as the tutorials show) without using vector dbs?

Thanks!

---

<div class="post-metadata">

**Author:** ![alvations](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alvations/32/97_2.png) [@alvations](https://discuss.huggingface.co/u/alvations)\
**Post date:** [June 14, 2023, 2:43am UTC](https://discuss.huggingface.co/t/pipeline-cannot-infer-suitable-model-classes-from-model-name/42776/2 "2023-06-14T02:43:58Z")

</div>

Also asked and answered on [python - Pipeline cannot infer suitable model classes from: \<model\_name\> - HuggingFace - Stack Overflow](https://stackoverflow.com/q/76447153/610569)

**TL;DR:** [Google Colab](https://colab.research.google.com/drive/1l2GiSSPbajVyp2Nk3CFT4t3uH6-5TiBe?usp=sharing)
