/ Модель

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

Контекст
2 048 токенов
Параметры
6,7 млрд
Лицензия
Apache 2.0
Архитектура
llama · dense
Опубликована
23 мар 2024

AnyGPT-base

Генерация текстаТекст → текст4 профессии

AnyGPT-base — мультимодальная модель на базе LLaMA для преобразования текста, изображений, речи и музыки, включая генерацию и распознавание.

174скачиваний за 30 дней12лайковвеса обновлены5 июн 2024

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

AnyGPT-base — базовая мультимодальная авторегрессионная модель команды OpenMOSS-Team, построенная на архитектуре LLaMA и объединяющая текст, изображения, речь и музыку через дискретные представления и предсказание следующего токена. Модель содержит 6,7 млрд параметров, использует формат PyTorch и имеет контекст 2048 токенов. Для обработки модальностей применяются отдельные токенизаторы и компоненты реконструкции: SpeechTokenizer и Soundstorm для речи, SEED-tokenizer для изображений, Encodec-32k для музыки и unCLIP SD-UNet для восстановления изображений.

Модель предназначена для преобразования данных между модальностями: генерации изображений, описания изображений, распознавания речи, синтеза речи, генерации музыки и создания описаний музыки. README указывает, что AnyGPT-base может выполнять эти задачи в заданном формате инструкций; примеры и метки языковой поддержки в метаданных относятся к английскому. Авторы отмечают нестабильность генерации из-за ограничений данных и вычислительных ресурсов, поэтому результат может требовать повторной генерации или настройки декодирования. Лицензия — исходная лицензия LLaMA 2.

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

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

Ограничения

Авторы сообщают, что генерация может быть нестабильной из-за ограничений данных и вычислительных ресурсов; результат иногда требует повторной генерации или настройки стратегии декодирования. Для модальных преобразований нужны отдельные токенизаторы и компоненты реконструкции.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

Base model for paper "AnyGPT: Unified Multimodal LLM with Discrete Sequence Modeling"

Introduction

We introduce AnyGPT, an any-to-any multimodal language model that utilizes discrete representations for the unified processing of various modalities, including speech, text, images, and music. The base model aligns the four modalities, allowing for intermodal conversions between different modalities and text. Furthermore, we constructed the AnyInstruct dataset based on various generative models, which contains instructions for arbitrary modal interconversion. Trained on this dataset, our chat model can engage in free multimodal conversations, where multimodal data can be inserted at will.

AnyGPT proposes a generative training scheme that converts all modal data into a unified discrete representation, using the Next Token Prediction task for unified training on a Large Language Model (LLM). From the perspective of 'compression is intelligence': when the quality of the Tokenizer is high enough, and the perplexity (PPL) of the LLM is low enough, it is possible to compress the vast amount of multimodal data on the internet into the same model, thereby emerging capabilities not present in a pure text-based LLM. Demos are shown in project page.

Example Demonstrations

视频标题

Inference

Installation

git clone https://github.com/OpenMOSS/AnyGPT.git
cd AnyGPT
conda create --name AnyGPT python=3.9
conda activate AnyGPT
pip install -r requirements.txt

Model Weights

The SpeechTokenizer is used for tokenizing and reconstructing speech, Soundstorm is responsible for completing paralinguistic information, and SEED-tokenizer is used for tokenizing images.

The model weights of unCLIP SD-UNet which are used to reconstruct the image, and Encodec-32k which are used to tokenize and reconstruct music will be downloaded automatically.

Base model CLI Inference

python anygpt/src/infer/cli_infer_base_model.py \
--model-name-or-path "path/to/AnyGPT-7B-base" \
--image-tokenizer-path models/seed-tokenizer-2/seed_quantizer.pt \
--speech-tokenizer-path "path/to/model" \
--speech-tokenizer-config "path/to/config" \
--soundstorm-path "path/to/model" \
--output-dir "infer_output/base" 

for example

python anygpt/src/infer/cli_infer_base_model.py \
--model-name-or-path models/anygpt/base \
--image-tokenizer-path models/seed-tokenizer-2/seed_quantizer.pt \
--speech-tokenizer-path models/speechtokenizer/ckpt.dev \
--speech-tokenizer-config models/speechtokenizer/config.json \
--soundstorm-path models/soundstorm/speechtokenizer_soundstorm_mls.pt \
--output-dir "infer_output/base" 

Interaction

The Base Model can perform various tasks, including text-to-image, image caption, Automatic Speech Recognition (ASR), Zero-shot Text-to-Speech (TTS), Text-to-Music, and Music Captioning.

We can perform inference following a specific instruction format.

  • Text-to-Image
    • text|image|{caption}
    • example: text|image|A bustling medieval market scene with vendors selling exotic goods under colorful tents
  • Image Caption
    • image|text|{caption}
    • example: image|text|static/infer/image/cat.jpg
  • TTS(random voice)
    • text|speech|{speech content}
    • example: text|speech|I could be bounded in a nutshell and count myself a king of infinite space.
  • Zero-shot TTS
    • text|speech|{speech content}|{voice prompt}
    • example: text|speech|I could be bounded in a nutshell and count myself a king of infinite space.|static/infer/speech/voice_prompt1.wav/voice_prompt3.wav
  • ASR
    • speech|text|{speech file path}
    • example: speech|text|AnyGPT/static/infer/speech/voice_prompt2.wav
  • Text-to-Music
    • text|music|{caption}
    • example:
      text|music|features an indie rock sound with distinct elements that evoke a dreamy, soothing atmosphere
  • Music Caption
    • music|text|{music file path}
    • example: music|text|static/infer/music/features an indie rock sound with distinct element.wav

Notes

For different tasks, we used different language model decoding strategies. The decoding configuration files for image, speech, and music generation are located in config/image_generate_config.json, config/speech_generate_config.json, and config/music_generate_config.json, respectively. The decoding configuration files for other modalities to text are in config/text_generate_config.json. You can directly modify or add parameters to change the decoding strategy.

Due to limitations in data and training resources, the model's generation may still be unstable. You can generate multiple times or try different decoding strategies.

The speech and music response will be saved to .wav files, and the image response will be saved to a jpg. The filename will be a concatenation of the prompt and the time. The paths to these files will be indicated in the response.

Training

Pretraining

  • Install dependency
    cd FastChat
    pip3 install -e ".[train]"
    
  • run
    srun --partition=llm_h --job-name=pretrain --gres=gpu:8 --quotatype=spot --ntasks=1 --ntasks-per-node=1 --cpus-per-task 100 --kill-on-bad-exit=1 bash scripts/stage1_pretrain.sh
    

We have provided some sample data in the "data" folder. To download the complete dataset, please refer to the following:

These data are preprocessed by multimodal tokeniziers.

Acknowledgements

Lincese

AnyGPT is released under the original License of LLaMA2.

Citation

If you find AnyGPT and AnyInstruct useful in your research or applications, please kindly cite:

@article{zhan2024anygpt,
  title={AnyGPT: Unified Multimodal LLM with Discrete Sequence Modeling},
  author={Zhan, Jun and Dai, Junqi and Ye, Jiasheng and Zhou, Yunhua and Zhang, Dong and Liu, Zhigeng and Zhang, Xin and Yuan, Ruibin and Zhang, Ge and Li, Linyang and others},
  journal={arXiv preprint arXiv:2402.12226},
  year={2024}
}

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

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

0 моделей