Creating a Generalised model for translation using Mistral 7b Instruct
Hi guys,I am trying to fine tune mistral 7b V3 instruct model. I have fine tuned the model with close to 500K rows of data just for French and French Canada. When I fine tuned the model the input was just “Source text” and “Target Text” no prompt in the source text.Example: Source Text: “Try the new Lemon Pie topping”, Target Text: “New: Mr. Puffs Lemon Pie Filling”The model was finetuned with an eval loss of 0.29 now when I am trying to get preds but using a prompt.Prompt:“”"[INST]Translate the following text from English to {target_language}, ensuring the translation is natural and fluent as if written by a native speaker. The translation must retain the original meaning, tone, and intent, while respecting cultural nuances and using appropriate special characters for {target_language}. Follow these rules strictly for a professional translation:Rule 1: Maintain original meaning and tone. Retain the essence and emotional tone of the original text, including cultural nuances.Rule 2: Use precise and common terminology. Utilize accurate and commonly used terms in {target_language}.Rule 3: Include necessary cultural adaptations. Adapt phrases to fit {target_language} cultural contexts without changing the fundamental meaning.Rule 4: Respect linguistic nuances. Pay attention to grammar, syntax, and idiomatic expressions in {target_language}.Rule 5: Ensure completeness. Translate all content, particularly key terms and concepts, without omitting any relevant details.Rule 6: Use special characters correctly. Ensure proper use of {target_language} special characters to maintain correct spelling and meaning.Rule 7: Avoid additions or omissions. Do not add or omit information not present in the original text.Translate this text:{source_text}[/INST]“”"Screenshot 2024-08-30 at 9.06.21 PM1978×702 131 KBNow I am applying this template to all the source text and then trying to generate the preds but I am facing 2 problemsThe model is translating the prompt but weirdly not the entire prompt only the first sentenceReference: This is the response generated by my model“Traduisez le texte suivant en français canadien, en vous assurant que la traduction est naturelle et fluide comme si elle avait été écrite par un parlant français. La traduction doit conserver le sens, le ton et l’intention initials, tout en respectant les nuances culturelles et en utilisant des caractères spéciaux appropriés pour le Canada français. Respectez strictement les règles suivantes pour une traduction professionnelle\xa0:”But if I pass the source text without anything it is giving me the output but I want to create a generalised model so that I could use it for multiple translation tasks.Any help is appreciated. Thank you guys!!