private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

Is it possible to ingest and ask about documents in spanish?

Open pablodegrande opened this issue 1 year ago • 1 comments

pablodegrande avatar May 14 '23 20:05 pablodegrande

If you're using gpt4all and llama embeddings, you should be able to ingest all of your documents in Spanish. You should also be able to ask your queries in Spanish to privateGPT. But the thing is that the model might answer your questions back in English though. This is hard to control as it is intrinsic to the models we're using.

One possible tweak for having some of the answers in Spanish would be to prompt it. Meaning you would explicitly ask the model to spit Spanish answer when calling the RetrievalQA. This should be better, but still a very partial solution.

andreakiro avatar May 15 '23 08:05 andreakiro

Exactly, the internal prompt being used by LangChain's RetrievalQA chain is in english. That is probably making the model answer in english. But you should be able to change it to use your custom prompt in Spanish.

imartinez avatar May 16 '23 18:05 imartinez

Hi, bonjour, I'll follow this topic with you, thank you for being there.

Orrouk avatar May 22 '23 00:05 Orrouk

@andreakiro Would you mind to share some example ? I tried the following :

def add_langage_prompt(query):
    return f'Parle moi en français. %s'%(query)

But I did not succeed. (Got "The question is unclear, could you please provide more context or rephrase it?"). I also try to add the langage prompt after the query but it replied in english. Maybe I should try another model ? Or do you have a example ?

mabihan avatar Jun 26 '23 11:06 mabihan