Ambiguity in Language detection

#7
by jdjayakaran - opened

Hi all,
I tried creating a chatbot with the LEOLM model. But, I face the error that at times it responds in German and at times in English. How to make the responses to be only in German?
Adding an example below.
Screenshot 2023-10-11 at 12.12.03.png

LAION LeoLM org

I would recommend using a German system prompt, this has worked very well for us. Something like Das ist eine Unterhaltung zwischen einem freundlichen, hilfreichen Assistenten und einem neugierig Nutzer.. Changing the system prompt significantly influences how the model responds. Follow the ChatML chat template (https://huggingface.co/docs/transformers/main/chat_templating) for best results. It's included in this repo.

I use a chain retrieval qa from langchain and use my own embeddings on the LEO model. So it faces quite some challenges on the Chat ML template

@bjoernp unfortunately this doesn't help. I used the following prompts and it still responded in English.
Bildschirmfoto 2023-10-13 um 10.20.40.png

LAION LeoLM org

I haven't seen language switching in our chat demo, so I'm not sure this is an issue on the model side. Is the context you are giving to the model English? Also, you are missing a "\n" after the "<|im_start|>system".

@jdjayakaran Because langchain just uses english prompt templates. Either skip the whole langchain part and use just the document splitting and create your own templates.

Sign up or log in to comment