transformers pytorch llama text-generation license:openrail autotrain_compatible text-generation-inference endpoints_compatible region:us
---
license: openrail
---

# parrot_en_es 13B V2 English to Spanish In-Context Translation Model

This is the second iteration of parrot_en_es model. First iteration is here: https://huggingface.co/eduardem/parrot_en_es

It was fine tuned with the same dataset as the first realease.
Welcome to the alpha release of parrot_en_es English to Spanish In-Context Translation Model, fine-tuned from LLaMa-2-13B with 250,000 real examples.
This model is uniquely designed to offer translations in specific contexts, ensuring the accuracy and relevancy of the translation.

## What's New in This Version

- **New Codebase**: This model has been fine-tuned using a completely new codebase for enhanced performance and reliability. Here is the code used for fine tuning: https://github.com/iongpt/qlora-llama2-orca/blob/main/fine_tune.py
- **Input Masking**: The model now masks the input during training to avoid calculating it in the loss ratio, ensuring more accurate translations.
- **32-bit Adam Optimizer**: The optimization process has been upgraded from an 8-bit to a 32-bit Adam optimizer for improved learning efficiency and faster convergence.
- **Bigger batch size**, **More epochs**


## Features:
1. Context-aware translations.
2. Preservation of original formatting including line breaks, HTML, XML, and more.
3. Suitable for various contexts, from mobile applications to anything else.

## Usage:

### Prompt Template:
To use this model effectively, adhere to the following prompt template. Only modify the text inside the quotation marks:

```
[INST] <<SYS>>
As a professional translator with expertise in English and Spanish, you are tasked with translating individual strings from English to Spanish. The translation must be provided in the context specified in the user prompt, such as a specific category or theme. It is imperative that you preserve all original formatting, including line breaks, HTML, XML, and any other formatting present in the source text. Your response must reflect the translated text while maintaining the integrity of the original format. Ensure that you do not add any formatting elements that were not present in the original text, and do not remove any formatting elements that are present in the original.
<</SYS>>

Translate the phrase "[Your English Text Here]" from English to Spanish in the context of a "[Your Context Here]"[/INST]
```

### Examples:
For translating "I am sleeping" in different contexts:

**Context 1**: Mobile iOS Application
Prompt:
```
[INST] <<SYS>>
As a professional translator with expertise in English and Spanish, you are tasked with translating individual strings from English to Spanish. The translation must be provided in the context specified in the user prompt, such as a specific category or theme. It is imperative that you preserve all original formatting, including line breaks, HTML, XML, and any other formatting present in the source text. Your response must reflect the translated text while maintaining the integrity of the original format. Ensure that you do not add any formatting elements that were not present in the original text, and do not remove any formatting elements that are present in the original.
<</SYS>>

Translate the phrase "tap" from English to Spanish in the context of a "Mobile iOS Application"[/INST]
```
Response:
```
[RSP] tocar [/RSP]

...other garbage to be ignored...
```
**Context 2**: Dance Guide
Prompt:
```
[INST] <<SYS>>
As a professional translator with expertise in English and Spanish, you are tasked with translating individual strings from English to Spanish. The translation must be provided in the context specified in the user prompt, such as a specific category or theme. It is imperative that you preserve all original formatting, including line breaks, HTML, XML, and any other formatting present in the source text. Your response must reflect the translated text while maintaining the integrity of the original format. Ensure that you do not add any formatting elements that were not present in the original text, and do not remove any formatting elements that are present in the original.
<</SYS>>

Translate the phrase "tap" from English to Spanish in the context of a "Dance Guide"[/INST]
```
Response:
```
[RSP] zapateo [/RSP]

...other garbage to be ignored...
```
## Important Notes:
- The model currently responds with the desired translation in the first block of the output. Any additional text after the initial block is considered extraneous and should be ignored.
- This is the first alpha release. We are actively working on improvements and further fine-tuning to enhance the model's capabilities.

## Feedback:
Your feedback is invaluable to us! If you encounter any issues or have suggestions for improvement, please reach out via the Community board.