# Facing issue building a simple RAG application using RetrievalQA

**URL:** <https://discuss.huggingface.co/t/facing-issue-building-a-simple-rag-application-using-retrievalqa/157340>\
**Category:** Beginners\
**Created:** [May 30, 2025, 5:54am UTC](https://discuss.huggingface.co/t/facing-issue-building-a-simple-rag-application-using-retrievalqa/157340 "2025-05-30T05:54:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaleensr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shaleensr/32/47299_2.png) [@Shaleensr](https://discuss.huggingface.co/u/Shaleensr)\
**Post date:** [May 30, 2025, 5:54am UTC](https://discuss.huggingface.co/t/facing-issue-building-a-simple-rag-application-using-retrievalqa/157340/1 "2025-05-30T05:54:11Z")

</div>

Hi all, Here is a simple RAG app code, I am facing issue running it. Issue probably lies in the HuggingFaceEndpoint’s repo\_id used. Could you please guide me what repo\_id should be used here? Also, how to identify when to use which repo\_id?

Here is the code:

```auto
from langchain_community.document_loaders import TextLoader

from langchain.text_splitter import RecursiveCharacterTextSplitter

from langchain_huggingface import HuggingFaceEmbeddings, HuggingFaceEndpoint

from langchain_community.vectorstores import FAISS

from langchain.chains import RetrievalQA

from dotenv import load_dotenv

load_dotenv()

# Loading a text file

loader = TextLoader("./Dummy_docs/Test_doc_1.txt")

documents = loader.load()

# Splitting the text into manageable chunks

splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)

chunks = splitter.split_documents(documents)

# Converting document chunks into embeddings and store in FAISS

embedding_model = HuggingFaceEmbeddings()

vectorstore = FAISS.from_documents(chunks, embedding_model)

# Creating a retriever from the vectorstore

retriever = vectorstore.as_retriever()

# Initializing the LLM endpoint

llm = HuggingFaceEndpoint(

repo_id="tiiuae/falcon-7b-instruct",

provider="auto"

)

# Create the RetrievalQA chain

qa_chain = RetrievalQA.from_chain_type(llm=llm, retriever=retriever)

# Define your user query

query = "Can I cancel my e-ticket booked online from Busways, at the counter?"

print(f"\nQuery: {query}\n")

# Get the answer

answer = qa_chain.run(query)

print("Answer:")

print(answer)

```

I am a beginner in GenAI. Than you for your support.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [May 30, 2025, 9:47am UTC](https://discuss.huggingface.co/t/facing-issue-building-a-simple-rag-application-using-retrievalqa/157340/2 "2025-05-30T09:47:56Z")

</div>

> **[tiiuae/falcon-7b-instruct · Hugging Face](https://huggingface.co/tiiuae/falcon-7b-instruct)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

The format of `repo_id` is correct, but since the model has not been deployed, it cannot be used as an API. Refer to the following post to find a model that can be used. Using a local model is more reliable, but requires a GPU.

> [@Persistent 404 Not Found Errors with Public Inference API](https://discuss.huggingface.co/t/persistent-404-not-found-errors-with-public-inference-api/154119/10):
>
> Hi all, thanks for reporting! You can check to see if your model is available to use with the HF Inference API (or any Inference Provider) here: [Models - Hugging Face](https://huggingface.co/models?inference_provider=hf-inference&sort=trending). If it’s not deployed by any Inference Provider, you can request provider support on the model page. Please note Inference Endpoints is available to use - more info here: [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index). Thanks!

---

<div class="post-metadata">

**Author:** ![Shaleensr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shaleensr/32/47299_2.png) [@Shaleensr](https://discuss.huggingface.co/u/Shaleensr)\
**Post date:** [May 30, 2025, 11:59am UTC](https://discuss.huggingface.co/t/facing-issue-building-a-simple-rag-application-using-retrievalqa/157340/3 "2025-05-30T11:59:26Z")

</div>

Got yu! I went ahead to check the supporting inference points, and it worked using this:

# Initializing the LLM endpoint

llm = HuggingFaceEndpoint(  
repo\_id=“HuggingFaceH4/zephyr-7b-beta”  
)

Thanks again!
