/ Модель

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

Контекст
8 192 токена
Параметры
8,8 млрд
Размер весов
18,8 ГБ
Лицензия
Своя лицензия
Архитектура
glm · dense
Опубликована
16 янв 2025

glm-4-9b-hf

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

Базовая языковая модель GLM-4-9B от Zhipu AI для генерации текста, рассуждений, математических задач и программирования.

1 986скачиваний за 30 дней10лайковвеса обновлены27 янв 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

GLM-4-9B — базовая плотная языковая модель семейства GLM-4, разработанная Zhipu AI. Репозиторий содержит версию с 8,8 млрд параметров в формате safetensors; она предназначена для генерации текста и служит базой для последующей настройки под диалоговые и другие задачи.

Модель оценивалась на задачах семантики, математики, рассуждений, программирования и общих знаний. В карточке описана многоязычная поддержка, включая китайский и английский; метаданные также указывают эти языки. Контекст этой версии составляет 8192 токена. Упомянутые в README возможности вызова инструментов, веб-поиска и контекст до 128K относятся к GLM-4-9B-Chat, а не к данной базовой версии.

Для работы с весами требуется transformers версии 4.46.0 или новее. Лицензия обозначена как other, поэтому условия использования следует сверить с лицензией репозитория. Модель не является мультимодальной: описание этой линейки отдельно выделяет GLM-4V-9B как визуальную модель.

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

  • генерация текста на китайском и английском языках
  • решение математических задач
  • построение рассуждений и ответы на вопросы по знаниям
  • генерация и дополнение кода
  • дообучение языковой модели под специализированные задачи

Ограничения

Это базовая модель, а не версия Chat с выравниванием под человеческие предпочтения; возможности Chat-версии, включая вызов инструментов и расширенный контекст, нельзя считать подтверждёнными для этого репозитория. Для загрузки требуется transformers 4.46.0 или новее.

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

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

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

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

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

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

Открыть на Hugging Face

glm-4-9b-hf

请阅读 中文版本.

If you are using the weights from this repository, please update to

transformers>=4.46.0

These weights are not compatible with older versions of the transformers library.

Model Introduction

GLM-4-9B is the open-source version of the latest generation of pre-trained models in the GLM-4 series launched by Zhipu AI. In the evaluation of data sets in semantics, mathematics, reasoning, code, and knowledge, GLM-4-9B and its human preference-aligned version GLM-4-9B-Chat have shown superior performance beyond Llama-3-8B. In addition to multi-round conversations, GLM-4-9B-Chat also has advanced features such as web browsing, code execution, custom tool calls (Function Call), and long text reasoning (supporting up to 128K context). This generation of models has added multi-language support, supporting 26 languages including Japanese, Korean, and German. We have also launched the GLM-4-9B-Chat-1M model that supports 1M context length (about 2 million Chinese characters) and the multimodal model GLM-4V-9B based on GLM-4-9B. GLM-4V-9B possesses dialogue capabilities in both Chinese and English at a high resolution of 1120*1120. In various multimodal evaluations, including comprehensive abilities in Chinese and English, perception & reasoning, text recognition, and chart understanding, GLM-4V-9B demonstrates superior performance compared to GPT-4-turbo-2024-04-09, Gemini 1.0 Pro, Qwen-VL-Max, and Claude 3 Opus.

We evaluated the GLM-4-9B base model on some typical tasks, and the results are as follows:

ModelMMLUC-EvalGPQAGSM8KMATHHumanEval
Llama-3-8B66.651.2-45.8--
Llama-3-8B-Instruct68.451.334.279.630.062.2
ChatGLM3-6B-Base61.469.0-72.325.7-
GLM-4-9B74.777.134.384.030.470.1

This repository is the base version of GLM-4-9B, supporting 8K context length.

Quick Start

For more inference code and requirements, please visit our github page.

Please strictly follow the dependencies to install, otherwise it will not run properly

Transformers Lib(4.46.0 and later version) for inference:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
import os

os.environ['CUDA_VISIBLE_DEVICES'] = '0' # Set the GPU number. If a single machine has a single card, specify one. If a single machine has multiple cards, specify multiple GPU numbers.

MODEL_PATH = "THUDM/glm-4-9b-hf"

model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True,
    device_map="auto"
).eval()
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)

encoding = tokenizer("what is your name?<|endoftext|>")
inputs = {key: torch.tensor([value]).to(device) for key, value in encoding.items()}

gen_kwargs = {"max_length": 2500, "do_sample": True, "top_k": 1}
with torch.no_grad():
    outputs = model.generate(**inputs, **gen_kwargs)
    outputs = outputs[:, inputs['input_ids'].shape[1]:]
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))

LICENSE

The weights of the GLM-4 model are available under the terms of LICENSE.

Citations

If you find our work useful, please consider citing the following paper.

@misc{glm2024chatglm,
      title={ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools}, 
      author={Team GLM and Aohan Zeng and Bin Xu and Bowen Wang and Chenhui Zhang and Da Yin and Diego Rojas and Guanyu Feng and Hanlin Zhao and Hanyu Lai and Hao Yu and Hongning Wang and Jiadai Sun and Jiajie Zhang and Jiale Cheng and Jiayi Gui and Jie Tang and Jing Zhang and Juanzi Li and Lei Zhao and Lindong Wu and Lucen Zhong and Mingdao Liu and Minlie Huang and Peng Zhang and Qinkai Zheng and Rui Lu and Shuaiqi Duan and Shudan Zhang and Shulin Cao and Shuxun Yang and Weng Lam Tam and Wenyi Zhao and Xiao Liu and Xiao Xia and Xiaohan Zhang and Xiaotao Gu and Xin Lv and Xinghan Liu and Xinyi Liu and Xinyue Yang and Xixuan Song and Xunkai Zhang and Yifan An and Yifan Xu and Yilin Niu and Yuantao Yang and Yueyan Li and Yushi Bai and Yuxiao Dong and Zehan Qi and Zhaoyu Wang and Zhen Yang and Zhengxiao Du and Zhenyu Hou and Zihan Wang},
      year={2024},
      eprint={2406.12793},
      archivePrefix={arXiv},
      primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
GlmForCausalLM
Ревизия весов
b44e98f

0 моделей