/ Модель

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

Лицензия
Своя лицензия
Опубликована
20 дек 2023

vietnamese-llama2-7b-120GB

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

Базовая модель BKAI на архитектуре Llama 2 7B, продолжительно предобученная преимущественно на вьетнамских текстах для генерации и дальнейшей адаптации.

0скачиваний за 30 дней36лайковвеса обновлены5 мар 2024

Бенчмарки

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

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

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

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

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

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

Vietnamese-Llama2-7B-120GB — базовая языковая модель, разработанная BKAI Foundation Models на основе Meta Llama 2 7B и продолжительно предобученная на корпусе преимущественно вьетнамских текстов. Она предназначена для генерации текста и служит основой для дальнейшей адаптации под конкретные задачи; для практического использования авторы рекомендуют дополнительное обучение с учителем (SFT).

Модель использует архитектуру Llama 2 и SentencePiece-токенизатор, обученный на расширенной подборке вьетнамских документов. По описанию авторов, токенизатор кодирует вьетнамский текст примерно вдвое компактнее, чем токенизатор ChatGPT, и примерно на 70% компактнее исходного Llama 2. Предобучающий корпус включал 104 ГБ вьетнамского и 20 ГБ английского текста из новостей, книг, Википедии, юридических и финансовых материалов и других источников. Репозиторий также предоставляет LoRA-компонент для интеграции с исходным Llama 2 7B.

Модель подходит для генерации и продолжения текста на вьетнамском и английском языках, а также для дальнейшей настройки на тематические сценарии. Она не является готовым чат-ассистентом без SFT. Применяются условия лицензии Meta Llama 2; авторы не гарантируют точность выходов и требуют соблюдать местные законы при коммерческом использовании.

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

  • генерация и продолжение текстов на вьетнамском языке
  • генерация и продолжение текстов на английском языке
  • подготовка основы для вьетнамского чат-ассистента после SFT
  • адаптация языковой модели к вьетнамским новостям и книгам
  • дообучение для работы с вьетнамскими юридическими и финансовыми текстами

Ограничения

Для практического применения требуется дополнительное обучение с учителем (SFT); модель может выдавать неточные ответы, и авторы не гарантируют их достоверность.

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

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

Открыть на Hugging Face

Github: https://github.com/bkai-research/Vietnamese-LLaMA-2

Tokenizer

We enhance our previous tokenizer in vietnamese-llama2-7b-40GB by training SentencePiece on a more extensive collection of clean Vietnamese documents spanning diverse domains such as news, books, stock, finance, and laws. In contrast to the previous version, we follow the original LLaMA-2 paper to split all numbers into individual digits. Again, the updated tokenizer markedly enhances the encoding of Vietnamese text, cutting down the number of tokens by 50% compared to ChatGPT and approximately 70% compared to the original Llama2.

Pretraining data

Here are our data sources:

  • 53 GB NewsCorpus (clean + dedup binhvq's NewsCorpus combined with our self-crawled data up to October 2023). Thanks iambestfeed for his great work in crawling news data.
  • 1.3 GB Vietnamese Wikipedia (updated to October 2023)
  • 8.5 GB Vietnamese books
  • 4.8 GB Vietnamese legal documents (clean and dedup)
  • 1.6 GB stock news (clean and dedup)
  • 43 GB Vietnamese text (subsampled from Culturax-vi)
  • 2.3 GB English Books (sub-sampled from pg19)
  • 2.2 GB English Wikipedia
  • 16 GB English text (subsampled from Culturax-en)

We then merge all data sources and perform the last deduplication, resulting in a final pretraining dataset of 124 GB, including 104 GB of Vietnamese text and 20 GB of English text.

Continual pretraining

We conduct a single-epoch continual pretraining using the Llama2-7B model.

We trained the model on a DGX A100 system, utilizing four GPU A100 in 40 days (about 4000 GPU hours).

Hyperparameters are set as follows:

  • Training Regime: BFloat16 mixed precision

  • Lora Config:

    {
      "base_model_name_or_path": "meta-llama/Llama-2-7b-hf",
      "bias": "none",
      "enable_lora": null,
      "fan_in_fan_out": false,
      "inference_mode": true,
      "lora_alpha": 32.0,
      "lora_dropout": 0.05,
      "merge_weights": false,
      "modules_to_save": [
        "embed_tokens",
        "lm_head"
      ],
      "peft_type": "LORA",
      "r": 8,
      "target_modules": [
        "q_proj",
        "v_proj",
        "k_proj",
        "o_proj",
        "gate_proj",
        "down_proj",
        "up_proj"
      ],
      "task_type": "CAUSAL_LM"
    }
    
    

We also provide the LoRA part so that you can integrate it with the original Llama2-7b by yourself.

Please note that this model requires further supervised fine-tuning (SFT) to be used in practice!

Usage and other considerations: We refer to the Llama 2

Training loss

The red line indicates the learning curve of vietnamese-llama2-7b-40GB, while the cyan one corresponds to the new model of 120 GB.

Disclaimer

This project is built upon Meta's Llama-2 model. It is essential to strictly adhere to the open-source license agreement of Llama-2 when using this model. If you incorporate third-party code, please ensure compliance with the relevant open-source license agreements. It's important to note that the content generated by the model may be influenced by various factors, such as calculation methods, random elements, and potential inaccuracies in quantification. Consequently, this project does not offer any guarantees regarding the accuracy of the model's outputs, and it disclaims any responsibility for consequences resulting from the use of the model's resources and its output. For those employing the models from this project for commercial purposes, developers must adhere to local laws and regulations to ensure the compliance of the model's output content. This project is not accountable for any products or services derived from such usage.

Acknowledgments

We extend our gratitude to PHPC - Phenikaa University and NVIDIA for their generous provision of computing resources for model training. Our appreciation also goes out to binhvq, iambestfeed and the other authors for their diligent efforts in collecting and preparing the Vietnamese text corpus.

Please cite our manuscript if this dataset is used for your work

  @article{duc2024towards,
    title={Towards Comprehensive Vietnamese Retrieval-Augmented Generation and Large Language Models},
    author={Nguyen Quang Duc, Le Hai Son, Nguyen Duc Nhan, Nguyen Dich Nhat Minh, Le Thanh Huong, Dinh Viet Sang},
    journal={arXiv preprint arXiv:2403.01616},
    year={2024}
  }

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

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

GPU в ailist

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

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

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
f158b30

0 моделей