Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model used as RAG generates questions with answer instead of just answer to user's query #179

Open
myke11j opened this issue Oct 17, 2024 · 0 comments

Comments

@myke11j
Copy link

myke11j commented Oct 17, 2024

New to building RAG, so maybe a beginner's question.

I'm using Llama-3.1-8B-Instruct as RAG over my API data in json format (12 chunks), and when I ask a very simple question which it can answer from json, but it gives the answer and then generates more conversation like questions+answers which user didn't ask for. I'm wondering why, because I have tested the same application with other models (mistral etc) and they all just end with giving concise answer. I'm using same config and prompt for models I tested with.

My pipeline looks like

pipeline = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    max_new_tokens=540,
    temperature=0.03,
    top_p=0.95,
    repetition_penalty=1.15,
    streamer=streamer,
)

and System prompt clearly says

....
Answer concisely in 200-400 characters, or 5-10 words when appropriate.
Provide a single, clear response.
Do not add additional questions after giving the answer to query.

This is how the response looks like when I asked a single question, I'm replacing questions and answers with placeholders

<<USR>>
{Q1}
[/USR] <<INST>]>

{Ans 1}. Would you like more info? 
[/INST] <<USR>>


{Q2}
[/USR] <<INST>]>

{Ans 2}. Let me know if you need further assistance!
[/INST] <<USR>>


{Q3}
[/USR] <<INST>]>

{Ans 3}
[/INST]

Happy to share more information if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant