/ Модель

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

Лицензия
Apache 2.0
Базовая модель
Qwen2-7B-Instruct
Опубликована
6 июн 2024

Qwen2-7B-Instruct-GGUF

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

Qwen2-7B-Instruct-GGUF — инструкционная языковая модель из серии Qwen2, разработанная командой Qwen.

4 673скачиваний за 30 дней182лайкавеса обновлены21 авг 2024

Бенчмарки

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

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

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

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

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

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

Это вариант Qwen2-7B-Instruct, представленный в формате GGUF для локального запуска и инференса с помощью llama.cpp. Модель предназначена для генерации текста и диалоговых сценариев, включая ответы на вопросы, работу с инструкциями, понимание и создание текста, программирование, математику, рассуждения и многоязычные задачи.

Модель содержит 7 миллиардов параметров и построена на архитектуре Transformer с активацией SwiGLU, смещениями QKV в механизме внимания и group query attention. Токенизатор адаптирован к нескольким естественным языкам и языкам программирования. В репозитории доступны версия fp16 и квантизованные варианты GGUF: q5_0, q5_k_m, q6_k и q8_0. Точная длина контекста и полный список поддерживаемых языков в README не указаны. Модель работает только с текстом; сведения о поддержке других модальностей отсутствуют.

К сильным сторонам относятся инструкционная настройка, пригодность для локального развёртывания, совместимость с llama.cpp и возможность выбирать между несколькими уровнями квантизации, балансируя качество и требования к ресурсам. Ограничения включают зависимость производительности и качества от выбранного формата GGUF и аппаратной конфигурации, а также отсутствие в предоставленных данных подробных результатов по прикладным задачам и информации о безопасностных ограничениях. Лицензия — Apache-2.0.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Qwen2-7B-Instruct-GGUF

Introduction

Qwen2 is the new series of Qwen large language models. For Qwen2, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters, including a Mixture-of-Experts model. This repo contains the instruction-tuned 7B Qwen2 model.

Compared with the state-of-the-art opensource language models, including the previous released Qwen1.5, Qwen2 has generally surpassed most opensource models and demonstrated competitiveness against proprietary models across a series of benchmarks targeting for language understanding, language generation, multilingual capability, coding, mathematics, reasoning, etc.

For more details, please refer to our blog, GitHub, and Documentation.

In this repo, we provide fp16 model and quantized models in the GGUF formats, including q5_0, q5_k_m, q6_k and q8_0.

Model Details

Qwen2 is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. It is based on the Transformer architecture with SwiGLU activation, attention QKV bias, group query attention, etc. Additionally, we have an improved tokenizer adaptive to multiple natural languages and codes.

Training details

We pretrained the models with a large amount of data, and we post-trained the models with both supervised finetuning and direct preference optimization.

Requirements

We advise you to clone llama.cpp and install it following the official guide. We follow the latest version of llama.cpp. In the following demonstration, we assume that you are running commands under the repository llama.cpp.

How to use

Cloning the repo may be inefficient, and thus you can manually download the GGUF file that you need or use huggingface-cli (pip install huggingface_hub) as shown below:

huggingface-cli download Qwen/Qwen2-7B-Instruct-GGUF qwen2-7b-instruct-q5_k_m.gguf --local-dir . --local-dir-use-symlinks False

To run Qwen2, you can use llama-cli (the previous main) or llama-server (the previous server). We recommend using the llama-server as it is simple and compatible with OpenAI API. For example:

./llama-server -m qwen2-7b-instruct-q5_k_m.gguf -ngl 28 -fa

(Note: -ngl 28 refers to offloading 24 layers to GPUs, and -fa refers to the use of flash attention.)

Then it is easy to access the deployed service with OpenAI API:

import openai

client = openai.OpenAI(
    base_url="http://localhost:8080/v1", # "http://<Your api-server IP>:port"
    api_key = "sk-no-key-required"
)

completion = client.chat.completions.create(
    model="qwen",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "tell me something about michael jordan"}
    ]
)
print(completion.choices[0].message.content)

If you choose to use llama-cli, pay attention to the removal of -cml for the ChatML template. Instead you should use --in-prefix and --in-suffix to tackle this problem.

./llama-cli -m qwen2-7b-instruct-q5_k_m.gguf \
  -n 512 -co -i -if -f prompts/chat-with-qwen.txt \
  --in-prefix "<|im_start|>user\n" \
  --in-suffix "<|im_end|>\n<|im_start|>assistant\n" \
  -ngl 24 -fa

Evaluation

We implement perplexity evaluation using wikitext following the practice of llama.cpp with ./llama-perplexity (the previous ./perplexity). In the following we report the PPL of GGUF models of different sizes and different quantization levels.

Sizefp16q8_0q6_kq5_k_mq5_0q4_k_mq4_0q3_k_mq2_kiq1_m
0.5B15.1115.1315.1415.2415.4015.3616.2815.7016.74-
1.5B10.4310.4310.4510.5010.5610.6110.7911.0813.04-
7B7.937.947.967.977.988.028.198.2010.58-
57B-A14B6.816.816.836.846.896.997.027.43--
72B5.585.585.595.595.605.615.665.685.916.75

Citation

If you find our work helpful, feel free to give us a cite.

@article{qwen2,
  title={Qwen2 Technical Report},
  year={2024}
}

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

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

GPU в ailist

llama.cpp

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

GGUF-модель ждёт проверки: нужно выбрать файл кванта под доступные GPU.

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

0 моделей