/ Модель

Характеристики

Контекст
4 096 токенов
Параметры
6,7 млрд
Размер весов
13,7 ГБ
Архитектура
llama · dense
Опубликована
17 дек 2023

OpenHathi-7B-English-to-Hinglish

Генерация текстаТекст → текст

Модель на базе Llama, дообученная для перевода с английского на хинглиш.

15скачиваний за 30 дней5лайковвеса обновлены17 дек 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

akashgoel-id/OpenHathi-7B-English-to-Hinglish — языковая модель на архитектуре Llama, созданная слиянием LoRA-адаптера с моделями Llama 2 7B и OpenHathi-7B-Base. Адаптер обучен на наборе данных для перевода с английского на хинглиш — смесь хинди и английского, записанная преимущественно латиницей. Модель содержит 6,7 млрд параметров и поддерживает контекст до 4096 токенов.

Модель предназначена для перевода английского текста на хинглиш. В карточке отмечено, что OpenHathi лучше справляется с этой задачей благодаря большему объёму данных на хинди в предобучении. Перевод идиом может быть чрезмерно буквальным, и смысл некоторых выражений передаётся неточно. Лицензия в предоставленных данных не указана.

Сценарии применения

  • перевод английских сообщений на хинглиш
  • создание хинглиш-версий коротких текстов
  • перевод повседневных фраз с английского на смесь хинди и английского

Ограничения

Перевод идиом может быть буквальным и не передавать их переносный смысл. В README также отмечена выраженная цензура модели.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

image/png

Model Details

This is a merge of lora trained on English to Hinglish translation dataset by NATERAW on llama2-7b and OPENHATHI-7B-BASE. Since openHathi has more hindi data in it's pretraining compared to llama2 the translation is significantly better.

Prompting

You can use the prompt template provided by nateraw "Translate from english to hinglish:\n{{en}}\n---\nTranslation:\n"

Sample code:

from transformers import LlamaForCausalLM, AutoTokenizer
import torch

device = "cuda:0"
tokenizer = AutoTokenizer.from_pretrained('akashgoel-id/OpenHathi-7B-English-to-Hinglish')
model = LlamaForCausalLM.from_pretrained('akashgoel-id/OpenHathi-7B-English-to-Hinglish', torch_dtype=torch.bfloat16).to(device)

PROMPT_TEMPLATE = (
    f"Translate from english to hinglish:\n{{en}}\n---\nTranslation:\n"
)
while True:
    userInput = input("Enter input: ")
    prompt = PROMPT_TEMPLATE.format(en=userInput)
    inputs = tokenizer(prompt, return_tensors="pt").to(device)
    generate_ids = model.generate(inputs.input_ids, max_length=500)
    print(tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0])

Limitations

The model is still not that good when it comes to idioms

  1. Input : When it rains, it pours

    Response: Jab baarish hoti hai, to baarish hoti hai

    Evaluation: This translation is quite literal and misses the idiomatic meaning. The original phrase implies that when something happens, it often happens to an extreme degree. The provided translation simply states that "when it rains, it rains," which doesn't capture the essence of the idiom.

  2. Input : Don't count your chickens before they hatch

    Response: Apne murgon ko ande se pahle na ginein

    Evaluation: This is a reasonable translation of the idiom, maintaining the metaphorical meaning about not making plans based on assumptions of uncertain future events.

  3. Input : Biting off more than you can chew

    Response: Aap jo chaba sakte hain usse adhik kaatna

    Evaluation : This translation captures the literal aspect of biting and chewing but may not fully convey the idiomatic sense of taking on a task that is too big or difficult to handle.

  4. Input : The ball is in your court

    Response : Gend aapke court mein hai

    Evaluation : This translation effectively communicates the meaning of the idiom, which is about it being someone else's turn to make a decision or take an action.

  5. Input : Beating around the bush

    Response : Bush ke chaaron or peetna

    Evaluation : This is a literal translation and doesn't quite capture the idiomatic meaning of avoiding the main point or not speaking directly about a subject. The phrase "Ghumaphira ke baat karna" would be more appropriate.

Next steps

  1. The model seems to be highly censored given it used llama2. Next step would be to remove some of censorship by finetuning on more uncensored data. (What WizardLM has done for llama2)
  2. Finetune on idioms

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Репозиторий недоступен на Hugging Face.

Класс архитектуры
LlamaForCausalLM
Ревизия весов
63960e6

0 моделей