/ Модель

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

Лицензия
Своя лицензия
Базовая модель
SeaLLM3-7B-Chat
Опубликована
12 июл 2024

SeaLLM3-7B-Chat-GGUF

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

QuantFactory/SeaLLM3-7B-Chat-GGUF — квантизированная версия чат-модели SeaLLMs/SeaLLM3-7B-Chat, созданная QuantFactory с использованием llama.cpp.

1 106скачиваний за 30 дней1лайквеса обновлены13 июл 2024

Бенчмарки

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

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

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

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

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

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

Семейство SeaLLMs разработано для работы с языками Юго-Восточной Азии; модель предназначена для генерации текста, диалогов и выполнения пользовательских инструкций.

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

Это текстовая autoregressive language model размером 7B параметров в квантизированном формате GGUF; конкретная схема квантизации и размер контекстного окна в README не указаны. Квантизация и совместимость с llama.cpp могут упростить локальный запуск и снизить требования к ресурсам, однако README не содержит точных требований к оборудованию и количественной оценки качества. Модель ограничена текстовой модальностью и, как и другие языковые модели, может допускать ошибки.

Лицензия обозначена как other с названием seallms; условия использования приведены по ссылке на лицензию SeaLLMs. Перед применением необходимо ознакомиться с ними.

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

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

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

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

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

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

Открыть на Hugging Face

QuantFactory/SeaLLM3-7B-Chat-GGUF

This is quantized version of SeaLLMs/SeaLLM3-7B-Chat created using llama.cpp

SeaLLM3 - Large Language Models for Southeast Asia

We introduce SeaLLM3, the latest series of the SeaLLMs (Large Language Models for Southeast Asian languages) family. It achieves state-of-the-art performance among models with similar sizes, excelling across a diverse array of tasks such as world knowledge, mathematical reasoning, translation, and instruction following. In the meantime, it was specifically enhanced to be more trustworthy, exhibiting reduced hallucination and providing safe responses, particularly in queries closed related to Southeast Asian culture.

🔥 Highlights

  • State-of-the-art performance compared to open-source models of similar sizes, evaluated across various dimensions such as human exam questions, instruction-following, mathematics, and translation.
  • Significantly enhanced instruction-following capability, especially in multi-turn settings.
  • Ensures safety in usage with significantly reduced instances of hallucination and sensitivity to local contexts.

Uses

SeaLLMs is tailored for handling a wide range of languages spoken in the SEA region, including English, Chinese, Indonesian, Vietnamese, Thai, Tagalog, Malay, Burmese, Khmer, Lao, Tamil, and Javanese.

This page introduces the SeaLLM3-7B-Chat model, specifically fine-tuned to follow human instructions effectively for task completion, making it directly applicable to your applications.

Get started with Transformers

To quickly try the model, we show how to conduct inference with transformers below. Make sure you have installed the latest transformers version (>4.40).

from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
  "SeaLLMs/SeaLLM3-7B-chat",
  torch_dtype=torch.bfloat16, 
  device_map=device
)
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLM3-7B-chat")

# prepare messages to model
prompt = "Hiii How are you?"
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(device)
print(f"Formatted text:\n {text}")
print(f"Model input:\n {model_inputs}")

generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, do_sample=True)
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)

print(f"Response:\n {response[0]}")

You can also utilize the following code snippet, which uses the streamer TextStreamer to enable the model to continue conversing with you:

from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import TextStreamer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
  "SeaLLMs/SeaLLM3-7B-chat",
  torch_dtype=torch.bfloat16, 
  device_map=device
)
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLM3-7B-chat")

# prepare messages to model
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
]

while True:
    prompt = input("User:")
    messages.append({"role": "user", "content": prompt})
    text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    model_inputs = tokenizer([text], return_tensors="pt").to(device)
    
    streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
    generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, streamer=streamer)
    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]
    messages.append({"role": "assistant", "content": response})

Inference with vllm

You can also conduct inference with vllm, which is a fast and easy-to-use library for LLM inference and serving. To use vllm, first install the latest version via pip install vllm.

from vllm import LLM, SamplingParams

prompts = [
    "Who is the president of US?",
    "Can you speak Indonesian?"
]

llm = LLM(ckpt_path, dtype="bfloat16")
sparams = SamplingParams(temperature=0.1, max_tokens=512)
outputs = llm.generate(prompts, sparams)

# print out the model response
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt}\nResponse: {generated_text}\n\n")

Bias, Risks, and Limitations

Disclaimer: We must note that even though the weights, codes, and demos are released in an open manner, similar to other pre-trained language models, and despite our best efforts in red teaming and safety fine-tuning and enforcement, our models come with potential risks, including but not limited to inaccurate, misleading or potentially harmful generation. Developers and stakeholders should perform their own red teaming and provide related security measures before deployment, and they must abide by and comply with local governance and regulations. In no event shall the authors be held liable for any claim, damages, or other liability arising from the use of the released weights, codes, or demos.

Evaluation

We conduct our evaluation along two dimensions:

  1. Model Capability: We assess the model's performance on human exam questions, its ability to follow instructions, its proficiency in mathematics, and its translation accuracy.
  2. Model Trustworthiness: We evaluate the model's safety and tendency to hallucinate, particularly in the context of Southeast Asia.

Model Capability

Multilingual World Knowledge - M3Exam

M3Exam consists of local exam questions collected from each country. It reflects the model's world knowledge (e.g., with language or social science subjects) and reasoning abilities (e.g., with mathematics or natural science subjects).

Modelenzhidthviavgavg_sea
Sailor-7B-Chat0.660.6520.4750.4620.5130.5520.483
gemma-7b0.7320.5190.4750.460.5940.5560.510
SeaLLM-7B-v2.50.7580.5810.4990.5020.6220.5920.541
Qwen2-7B0.8150.8740.530.4790.6280.6650.546
Qwen2-7B-Instruct0.8090.880.5580.5550.6240.6850.579
Sailor-14B0.7480.840.5360.5280.6210.6550.562
Sailor-14B-Chat0.7490.8430.5530.5660.6370.670.585
SeaLLM3-7B0.8140.8660.5490.520.6280.6750.566
SeaLLM3-7B-Chat0.8090.8740.5580.5690.6490.6920.592

Multilingual Instruction-following Capability - SeaBench

SeaBench consists of multi-turn human instructions spanning various task types. It evaluates chat-based models on their ability to follow human instructions in both single and multi-turn settings and assesses their performance across different task types. The dataset and corresponding evaluation code will be released soon!

modelidturn1idturn2idavgthturn1thturn2thavgviturn1viturn2viavgavg
Qwen2-7B-Instruct5.935.845.895.475.205.346.175.605.895.70
SeaLLM-7B-v2.56.274.965.625.793.824.816.024.025.025.15
Sailor-14B-Chat5.265.535.404.624.364.495.314.745.034.97
Sailor-7B-Chat4.604.044.323.943.173.564.823.624.224.03
SeaLLM3-7B-Chat6.736.596.666.485.906.196.345.796.076.31

Multilingual Math

We evaluate the multilingual math capability using the MGSM dataset. MGSM originally contains Chinese and Thai testing sets only, we use Google Translate to translate the same English questions into other SEA languages. Note that we adopt the tradition of each country to represent the number, e.g., in Indonesian and Vietnamese, dots are used as thousands separators and commas as decimal separators, the opposite of the English system.

MGSMenidmsthvizhavg
Sailor-7B-Chat33.622.422.421.625.229.225.7
Meta-Llama-3-8B-Instruct77.64857.65646.858.857.5
glm-4-9b-chat72.853.653.634.852.470.856.3
Qwen1.5-7B-Chat6434.438.425.23653.641.9
Qwen2-7B-instruct8266.462.458.464.476.868.4
aya-23-8B28.816.414.421612.815.1
gemma-1.1-7b-it58.832.434.831.239.635.238.7
SeaLLM-7B-v2.579.669.270.861.266.862.468.3
SeaLLM3-7B-Chat74.871.270.871.271.279.673.1

Translation

We use the test sets from Flores-200 for evaluation and report the zero-shot chrF scores for translations between every pair of languages. Each row in the table below presents the average results of translating from various source languages into the target languages. The last column displays the overall average results of translating from any language to any other language for each model.

modelenidjvkmlomsmytathtlvizhavg
Meta-Llama-3-8B-Instruct51.5449.0322.4615.345.4246.7221.2432.0935.7540.839.3114.8731.22
Qwen2-7B-Instruct50.3647.5529.3619.2611.0642.4319.3320.0436.0737.9139.6322.8731.32
Sailor-7B-Chat49.449.7828.332.686.8547.755.3518.2338.922941.7620.8728.24
SeaLLM-7B-v2.555.0953.7118.1318.0915.5351.3319.7126.140.5545.5844.5624.1834.38
SeaLLM3-7B-Chat54.6852.5229.8627.326.3445.0421.5431.9341.5238.5143.7826.136.52

Model Trustworthiness

Hallucination

Performance of whether a model can refuse questions about the non-existing entity. The following is the F1 score. We use refuse as the positive label. Our test set consists of ~1k test samples per language. Each unanswerable question is generated by GPT4o. The ratio of answerable and unanswerable questions are 1:1. We define keywords to automatically detect whether a model-generated response is a refusal response.

Refusal-F1 Scoresenzhvithidavg
Qwen1.5-7B-Instruct53.8551.7052.8535.558.450.46
Qwen2-7B-Instruct58.7933.0856.2144.655.9849.732
SeaLLM-7B-v2.512.900.772.4519.420.787.26
Sailor-7B-Chat33.4918.825.199.6816.4216.72
glm-4-9b-chat44.4837.8918.664.271.9721.45
aya-23-8B6.380.792.831.9814.805.36
Llama-3-8B-Instruct72.080.001.230.803.9115.60
gemma-1.1-7b-it52.3927.7423.9622.9731.7231.76
SeaLLM3-7B-Chat71.3678.3977.9361.3168.9571.588

Safety

Multijaildataset consists of harmful prompts in multiple languages. We take those relevant prompts in SEA languages here and report their safe rate (the higher the better).

Modelenjvthvizhavg
Qwen2-7B-Instruct0.88570.43810.63810.73020.8730.713
Sailor-7B-Chat0.78730.54920.62220.67620.76190.6794
Meta-Llama-3-8B-Instruct0.88250.26350.71110.69840.77140.6654
Sailor-14B-Chat0.86980.30480.53650.60950.7270.6095
glm-4-9b-chat0.77140.21270.30160.60630.74920.52824
SeaLLM3-7B-Chat0.88890.60000.73330.83810.9270.7975

Model Acknowledgement to Our Linguists

We would like to express our special thanks to our professional and native linguists, Tantong Champaiboon, Nguyen Ngoc Yen Nhi and Tara Devina Putri, who helped build, evaluate, and fact-check our sampled pretraining and SFT dataset as well as evaluating our models across different aspects, especially safety.

Original Model Citation

If you find our project useful, we hope you would kindly star our repo and cite our work as follows:

@article{damonlp2024seallm3,
  author = {Wenxuan Zhang*, Hou Pong Chan*, Yiran Zhao*, Mahani Aljunied*,
            Jianyu Wang, Chaoqun Liu, Yue Deng, Zhiqiang Hu, Weiwen Xu,
            Yew Ken Chia, Xin Li, Lidong Bing},
  title = {SeaLLMs - Large Language Models for Southeast Asia},
  year = {2024},
}

Corresponding Author: l.bing@alibaba-inc.com

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

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

GPU в ailist

llama.cpp

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

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

Ревизия весов
59d936e

0 моделей