/ Модель

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

Контекст
32 768 токенов
Параметры
7,1 млрд
Размер весов
15,2 ГБ
Лицензия
Apache 2.0
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-7B
Опубликована
1 ноя 2024

TableGPT2-7B

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

TableGPT2-7B — дообученная модель Zhejiang University для анализа табличных данных, генерации кода и ответов на вопросы бизнес-аналитики.

638скачиваний за 30 дней232лайкавеса обновлены13 фев 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

TableGPT2-7B — языковая модель Zhejiang University для анализа таблиц и задач, связанных со структурированными данными. Это дообученная модель семейства Qwen2.5 с архитектурой Qwen2ForCausalLM и 7,1 млрд параметров. Она принимает текст и табличные данные, представленные в текстовом виде, например как результат df.head(), и формирует текстовые ответы.

Модель предназначена для интерпретации таблиц, генерации кода, ответов на вопросы бизнес-аналитики и обработки запросов к базам данных и хранилищам. В карточке заявлена длина контекста 32 768 токенов; README приводит для обучения конфигурации контекст в 128K токенов, поэтому фактический предел использования следует сверять с настройками конкретной сборки. Модель отдельно описана как декодер, способный работать без специализированного семантического энкодера, интеграция которого ещё готовится.

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

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

  • ответы на вопросы по таблицам и результатам df.head()
  • анализ структурированных бизнес-данных
  • генерация кода для обработки табличных данных
  • подготовка выводов по данным для бизнес-аналитики
  • разбор запросов к базам данных и хранилищам

Ограничения

Модель ориентирована прежде всего на китайский язык, а запросы на других языках могут поддерживаться ограниченно. Обучающие данные ограничены октябрём 2024 года; для практического использования также следует учитывать различие между заявленной в метаданных длиной контекста 32 768 токенов и указанными в README 128K токенами.

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

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

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

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

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

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

Открыть на Hugging Face

TableGPT2-7B

Model details

We developed and released TableGPT2-7B, a large-scale decoder specifically tailored for data-intensive tasks, with a focus on interpreting and analyzing tabular data. TableGPT2-7B is designed to bridge the gap between conventional LLM capabilities and the real-world demands of tabular/structured data tasks, such as those in business intelligence (BI), automated data-driven analysis, and application tasks tightly involving databases or data warehouses.

Model Developers

Zhejiang University

Variations

TableGPT2 is available in two configurations—7B and 72B parameters—both derived from the Qwen2.5 model family and optimized for handling structured data in tabular formats. Currently, we have released the 7B version to the public.

Input

TableGPT2-7B accepts both text and tabular data as input, with the tabular data structured as text in the format of a df.head() result.

Output

TableGPT2-7B produces text-based outputs, specifically optimized for coding tasks, data interpretation, and BI-focused question answering.

Language

Our model places a strong emphasis on Chinese corpora, and currently, queries in other languages may have limited support.

Other Requirements

We highly recommend exploring our repository on GitHub, where users can integrate this model into our agent workflow for enhanced performance.

Model Architecture

TableGPT2-7B is built upon the Qwen2.5 architecture and includes specialized encoding for tabular data. It features a unique semantic encoder designed to interpret tabular data, capturing insights from rows, columns, and entire tables. Continual Pretraining (CPT) and Supervised Fine-Tuning (SFT) have been applied to equip the model for real-world BI applications and complex query processing.

For now, the standalone decoder is open-sourced and fully functional without having to require assistance from the encoder. The encoder is currently under preparation, pending engineering considerations, primarily because we hope to provide a tighter integration with DeepSpeed and vLLM.

Training DataParamsContext LengthTokensTables
TableGPT2-7BMultimodal data sources and BI-specific examples7B128K86B tokens CPT, 2.36M SFT samples593.8K tables

Status

This model is static, trained on an offline dataset. Future versions may be released to enhance its performance on specialized tasks.

QuickStart

This code snippet demonstrates how to build a prompt with table information, and shows how to load the tokenizer, load the model, and generate content.

Note that you need transformers>=4.37.0 to use TableGPT2:

pip install transformers>=4.37.0
from transformers import AutoModelForCausalLM, AutoTokenizer

# Using pandas to read some structured data
import pandas as pd
from io import StringIO

# single table
EXAMPLE_CSV_CONTENT = """
"Loss","Date","Score","Opponent","Record","Attendance"
"Hampton (14–12)","September 25","8–7","Padres","67–84","31,193"
"Speier (5–3)","September 26","3–1","Padres","67–85","30,711"
"Elarton (4–9)","September 22","3–1","@ Expos","65–83","9,707"
"Lundquist (0–1)","September 24","15–11","Padres","67–83","30,774"
"Hampton (13–11)","September 6","9–5","Dodgers","61–78","31,407"
"""

csv_file = StringIO(EXAMPLE_CSV_CONTENT)
df = pd.read_csv(csv_file)

model_name = "tablegpt/TableGPT2-7B"

model = AutoModelForCausalLM.from_pretrained(
    model_name, torch_dtype="auto", device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

example_prompt_template = """Given access to several pandas dataframes, write the Python code to answer the user's question.

/*
"{var_name}.head(5).to_string(index=False)" as follows:
{df_info}
*/

Question: {user_question}
"""
question = "哪些比赛的战绩达到了40胜40负?"

prompt = example_prompt_template.format(
    var_name="df",
    df_info=df.head(5).to_string(index=False),
    user_question=question,
)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt},
]
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(**model_inputs, max_new_tokens=512)
generated_ids = [
    output_ids[len(input_ids) :]
    for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

Complex Usage Scenarios

For complex usage scenarios, we provide a tablegpt-agent toolkit to help you more conveniently handle various types of tabular inputs.

This agent is built on top of the Langgraph library and provides a user-friendly interface for interacting with TableGPT2.

Deployment

For deployment, we recommend using vLLM.

  • Install vLLM: You can install vLLM by running the following command.

    pip install "vllm>=0.5.5"
    
  • Model Deployment: Use vLLM to deploy your model. For example, you can use the command to set up a server similar to openAI:

    python -m vllm.entrypoints.openai.api_server --served-model-name TableGPT2-7B --model path/to/weights
    

    Then you can access the Chat API by:

    curl http://localhost:8000/v1/chat/completions \
        -H "Content-Type: application/json" \
        -d '{
        "model": "TableGPT2-7B",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Hey, who are you?"}
        ]
        }'
    
    

    For more details about how to use TableGPT2, please refer to our repository on GitHub

License

TableGPT2-7B is under apache-2.0 license.

Research Paper

TableGPT2-7B is introduced and validated in the paper "TableGPT2: A Large Multimodal Model with Tabular Data Integration" available on arXiv.

Where to send questions or comments about the model

Inquiries and feedback are welcome at j.zhao@zju.edu.cn.

Training Data

Overview

Training for TableGPT2-7B involved more than 593,800 curated tables, over 86 billion tokens for continual pretraining (CPT) and the construction of over 2.36 million high-quality query-table-output tuples for supervised fine-tuning. This extensive dataset aims to meet the rigorous demands of modern applications involving structured or tabular data.

Data Freshness

The training data has a cutoff of October 2024.

Evaluation Results

Evaluation has shown that TableGPT2-7B performs consistently well across benchmarks for tabular comprehension, code generation, and structured data reasoning, achieving a 35.20% performance increase over comparable models on standard benchmarks and 49.32% on BI-focused assessments. The RealTabBench benchmark further demonstrated the model’s robustness in handling unconventional tables and complex queries. Below, we present the results on public table-related benchmarks.

BenchmarkMetricGPT-4oTableLLM (Qwen2)TableLLM (CodeQwen)TableLLM (LLaMA3)TableLLM (LLaMA3.1)TableLLM (DeepSeek)TableLLM-13BDeepSeek-liteYi-CoderQwen2.5-CoderQwen2.5-InstructTableGPT2-7BTableGPT2-72B
Table Understanding
Col Type Annot.F131.7510.105.711.471.596.0412.7020.585.3832.5922.1985.8885.67
Relation Extract.F152.951.603.792.392.003.3418.168.672.2531.0015.9283.3579.50
Entity LinkingAcc90.8047.1039.700.200.6015.5066.2570.1541.7571.7082.2592.0093.30
Row Pop.MAP53.402.205.141.936.233.1314.251.201.0013.2312.3059.9755.83
Question Answering
HiTabExec Acc48.4011.740.000.000.0039.086.300.760.001.7010.7370.2775.57
FetaQABLEU21.7012.248.692.423.107.9410.8315.0811.1713.0016.9128.9732.25
HybridQAAcc58.6027.1220.1427.3527.6119.5351.8842.5829.8351.1051.1353.1756.41
WikiSQLAcc47.6046.5037.2039.2639.0036.1441.1038.3025.3446.9047.4253.7457.32
WikiTQAcc68.4064.1636.0534.9538.8436.0566.3047.6543.3774.5068.5561.4271.45
Fact Verification
TabFactAcc74.4072.0053.2040.0627.1360.7668.9562.2779.677.2684.6077.8085.43
FEVEROUSAcc71.6020.1046.9051.5042.3018.3921.457.8038.1060.7063.3078.0576.80
Table to Text
ToTToBLEU12.216.953.105.506.233.815.368.762.6410.5011.9114.1022.69
Natural Language to SQL
BIRD(dev)Exec Acc-9.137.371.832.480.390.7225.1024.1927.1818.9731.4238.40
BIRD(dev-knowledge)Exec Acc-15.4518.193.393.720.391.8336.5139.9642.9631.4249.2860.76
Spider(dev)Exec Acc-42.2632.8812.8618.962.714.2666.4458.1270.9961.7076.3179.40
Spider(test)Exec Acc-40.2934.9312.0216.357.332.9366.6556.8769.7360.1874.3878.48
Holistic Table Evaluation
TableBenchDP-26.6226.4426.7126.7326.153.8829.6021.9428.6725.1832.0338.90
TableBenchTCoT-37.0831.3329.7930.0128.653.8530.9322.836.2529.7742.3450.06
TableBenchSCoT-14.1117.789.6012.3822.392.8822.618.4325.9524.3525.0130.47
TableBenchPoT@1-21.0526.3931.9625.8028.392.9410.9011.3616.1522.5833.5228.98

Citation

If you find our work helpful, please cite us by

@misc{su2024tablegpt2largemultimodalmodel,
      title={TableGPT2: A Large Multimodal Model with Tabular Data Integration}, 
      author={Aofeng Su and Aowen Wang and Chao Ye and Chen Zhou and Ga Zhang and Guangcheng Zhu and Haobo Wang and Haokai Xu and Hao Chen and Haoze Li and Haoxuan Lan and Jiaming Tian and Jing Yuan and Junbo Zhao and Junlin Zhou and Kaizhe Shou and Liangyu Zha and Lin Long and Liyao Li and Pengzuo Wu and Qi Zhang and Qingyi Huang and Saisai Yang and Tao Zhang and Wentao Ye and Wufang Zhu and Xiaomeng Hu and Xijun Gu and Xinjie Sun and Xiang Li and Yuhang Yang and Zhiqing Xiao},
      year={2024},
      eprint={2411.02059},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2411.02059}, 
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей