XVERSE-7B-Chat-GPTQ-Int8
模型介绍
XVERSE-7B-Chat为XVERSE-7B模型对齐后的版本。
XVERSE-7B 是由深圳元象科技自主研发的支持多语言的大语言模型(Large Language Model),参数规模为 70 亿,主要特点如下:
- 模型结构:XVERSE-7B 使用主流 Decoder-only 的标准 Transformer 网络结构,支持 8K 的上下文长度(Context Length),能满足更长的多轮对话、知识问答与摘要等需求,模型应用场景更广泛。
- 训练数据:构建了 2.6 万亿 token 的高质量、多样化的数据对模型进行充分训练,包含中、英、俄、西等 40 多种语言,通过精细化设置不同类型数据的采样比例,使得中英两种语言表现优异,也能兼顾其他语言效果。
- 分词:基于 BPE(Byte-Pair Encoding)算法,使用上百 GB 语料训练了一个词表大小为 100,534 的分词器,能够同时支持多语言,而无需额外扩展词表。
- 训练框架:自主研发多项关键技术,包括高效算子、显存优化、并行调度策略、数据-计算-通信重叠、平台和框架协同等,让训练效率更高,模型稳定性强,在千卡集群上的峰值算力利用率可达到 58.5%,位居业界前列。
Model Introduction
XVERSE-7B-Chat is the aligned version of model XVERSE-7B
XVERSE-7B is a multilingual large language model, independently developed by Shenzhen Yuanxiang Technology. Its key features are as follows:
- Model Structure: XVERSE-7B uses the mainstream Decoder-only Transformer network structure, supports 8k context length, which can meet the need of longer multi-round dialogues, knowledge question-answering, and summarization. This makes the model more versatile in application scenarios.
- Training Data: The model has been thoroughly trained on a diversified and high-quality dataset consisting of 2.6 trillion of tokens, including more than 40 languages such as Chinese, English, Russian, and Spanish. The sampling ratio of different types of data is finely set, which makes the performance of Chinese and English excellent, and also takes into account the effect of other languages.
- Tokenization: Based on the BPE (Byte-Pair Encoding) algorithm, a tokenizer with a vocabulary size of 100,534 has been trained using hundreds of gigabytes of language data. This tokenizer is capable of supporting multilingual without the need for additional vocabulary expansion.
- Training Framework: Several key technologies have also been independently developed, including efficient operators, memory optimization, parallel scheduling strategies, overlap of data-computation-communication, and synergy between platforms and frameworks. These advancements enhance training efficiency and model stability. With these technologies, the peak computational power utilization rate on a thousand-card cluster can reach 58.5%, ranking at the forefront of the industry.
环境准备
我们建议您克隆vllm
并按照官方指南进行安装。
Environment Setup
We advise you to clone vllm
and install it following the official guide.
使用方法
我们演示了如何使用 vLLM 来运行XVERSE-7B-Chat-GPTQ-Int8量化模型:
from vllm import LLM, SamplingParams
model_dir = "xverse/XVERSE-7B-Chat-GPTQ-Int8/"
# Create an LLM.
llm = LLM(model_dir,
trust_remote_code=True)
# Create a sampling params object.
sampling_params = SamplingParams(temperature=0.5, top_p=0.85, max_tokens=2048, repetition_penalty=1.1)
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
prompts = ["Human: 请你写一篇关于环保的文章,题材是从个人做起。\n\nAssistant: ",]
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Generated text:\n{generated_text}")
Usage
We demonstrated how to use vLLM to run the XVERSE-7B-Chat-GPTQ-Int8 quantization model:
from vllm import LLM, SamplingParams
model_dir = "xverse/XVERSE-7B-Chat-GPTQ-Int8/"
# Create an LLM.
llm = LLM(model_dir,
trust_remote_code=True)
# Create a sampling params object.
sampling_params = SamplingParams(temperature=0.5, top_p=0.85, max_tokens=2048, repetition_penalty=1.1)
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
prompts = ["Human: 请你写一篇关于环保的文章,题材是从个人做起。\n\nAssistant: ",]
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Generated text:\n{generated_text}")
局限性与免责申明
XVERSE-7B-Chat 与其他所有 LLM 一样,在某些情况下可能会产生不准确、有偏见或其他令人反感的内容。因此,请谨慎使用模型生成的内容,请勿将生成的有害内容进行传播,在部署任何 XVERSE-7B-Chat 的应用之前,开发人员应根据其具体应用对模型进行安全测试和调优。
我们强烈警告不要将 XVERSE-7B-Chat 模型用于制造或传播有害信息,或进行任何可能损害公众、国家、社会安全或违反法规的活动。如果使用 XVERSE-7B-Chat 模型产生任何问题,无论是数据安全问题、公共舆论风险,还是模型被误解、滥用、传播或不合规使用所引发的任何风险和问题,我们将不承担任何责任。
Limitations and Disclaimer
Like all other Large Language Models (LLMs), XVERSE-7B-Chat may produce inaccurate, biased, or otherwise offensive content under certain circumstances. Therefore, please use the content generated by the model with caution and refrain from disseminating harmful content. Before deploying any application of XVERSE-7B-Chat, developers should conduct safety tests and optimization of the model according to its specific application.
We strongly warn against the use of the XVERSE-7B-Chat model for producing or spreading harmful information, or conducting any activities that might harm the public, national, or social security, or violate regulations. We assume no responsibility for any problems arising from the use of the XVERSE-7B-Chat model, whether it be data security issues, public opinion risks, or any risks and issues caused by misunderstanding, misuse, dissemination, or non-compliance with the model.
模型开源协议
使用本仓库的源码需要遵循 Apache-2.0 开源协议,使用 XVERSE-7B-Chat 的模型权重则需要遵循模型许可协议。
XVERSE-7B-Chat 模型权重对学术研究完全开放,并且支持免费商用。如需申请商业许可证,请填写【申请表】,如有其他问题或合作,请联系 opensource@xverse.cn。
Open Source License
The use of the source code in this repository must follow the Apache-2.0 open-source license, while the use of the model weights of XVERSE-7B-Chat needs to adhere to the Model License Agreement.
The XVERSE-7B-Chat model weights are fully open to academic research and support free commercial use. To apply for a commercial license, please fill in the application form. For other questions or collaborations, please contact opensource@xverse.cn.
- Downloads last month
- 1