Downloads · 30 days
68
6% of all-time downloads
xverse/XVERSE-MoE-A4.2B-Chat
XVERSE-MoE-A4.2B-Chat is a text generation model from xverse. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
XVERSE-MoE-A4.2B-Chat为 XVERSE-MoE-A4.2B 底座模型对齐后的版本。
Downloads · 30 days
68
6% of all-time downloads
All-time downloads
1.2K
Public
Repo size
51.6 GB
Likes
2
Public
Click a slice to open those files.
.bin51.6 GB · 100%
From the Hugging Face model README
XVERSE-MoE-A4.2B-Chat为 XVERSE-MoE-A4.2B 底座模型对齐后的版本。
XVERSE-MoE-A4.2B 是由深圳元象科技自主研发的支持多语言的大语言模型(Large Language Model),使用混合专家模型(MoE,Mixture-of-experts)架构,模型的总参数规模为 258 亿,实际激活的参数量为 42 亿,本次开源的模型为底座模型 XVERSE-MoE-A4.2B,主要特点如下:
XVERSE-MoE-A4.2B 的模型大小、架构和学习率如下:
| total params | activated params | n_layers | d_model | n_heads | d_ff | n_non_shared_experts | n_shared_experts | top_k | lr |
|---|---|---|---|---|---|---|---|---|---|
| 25.8B | 4.2B | 28 | 2560 | 32 | 1728 | 64 | 2 | 6 | 3.5e−4 |
XVERSE-MoE-A4.2B-Chat is the aligned version of model XVERSE-MoE-A4.2B.
XVERSE-MoE-A4.2B is a multilingual large language model, independently developed by Shenzhen Yuanxiang Technology which is using Mixture-of-experts (MoE) architecture. The total parameter scale of the model is 25.8 billion, with an actual number of activated parameters being 4.2 billion. The models released this time is the base model XVERSE-MoE-A4.2B. Its key features are as follows:
The models sizes, architectures and learning rate of XVERSE-MoE-A4.2B are showed as follows:
| total params | activated params | n_layers | d_model | n_heads | d_ff | n_non_shared_experts | n_shared_experts | top_k | lr |
|---|---|---|---|---|---|---|---|---|---|
| 25.8B | 4.2B | 28 | 2560 | 32 | 1728 | 64 | 2 | 6 | 3.5e−4 |
可通过以下代码加载 XVERSE-MoE-A4.2B-Chat 模型来进行推理:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("xverse/XVERSE-MoE-A4.2B-Chat")
model = AutoModelForCausalLM.from_pretrained("xverse/XVERSE-MoE-A4.2B-Chat", trust_remote_code=True, torch_dtype=torch.bfloat16, device_map='auto')
model = model.eval()
inputs = tokenizer('北京的景点:故宫、天坛、万里长城等。\n深圳的景点:', return_tensors='pt').input_ids
inputs = inputs.cuda()
generated_ids = model.generate(inputs, max_new_tokens=64, eos_token_id=tokenizer.eos_token_id, repetition_penalty=1.1)
print(tokenizer.batch_decode(generated_ids, skip_special_tokens=True))
The XVERSE-MoE-A4.2B-Chat model can be loaded for inference using the following code:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("xverse/XVERSE-MoE-A4.2B-Chat")
model = AutoModelForCausalLM.from_pretrained("xverse/XVERSE-MoE-A4.2B-Chat", trust_remote_code=True, torch_dtype=torch.bfloat16, device_map='auto')
model = model.eval()
inputs = tokenizer('北京的景点:故宫、天坛、万里长城等。\n深圳的景点:', return_tensors='pt').input_ids
inputs = inputs.cuda()
generated_ids = model.generate(inputs, max_new_tokens=64, eos_token_id=tokenizer.eos_token_id, repetition_penalty=1.1)
print(tokenizer.batch_decode(generated_ids, skip_special_tokens=True))
XVERSE-MoE-A4.2B-Chat 与其他所有 LLM 一样,在某些情况下可能会产生不准确、有偏见或其他令人反感的内容。因此,请谨慎使用模型生成的内容,请勿将生成的有害内容进行传播,在部署任何 XVERSE-MoE-A4.2B-Chat 的应用之前,开发人员应根据其具体应用对模型进行安全测试和调优。
我们强烈警告不要将 XVERSE-MoE-A4.2B-Chat 模型用于制造或传播有害信息,或进行任何可能损害公众、国家、社会安全或违反法规的活动。如果使用 XVERSE-MoE-A4.2B-Chat 模型产生任何问题,无论是数据安全问题、公共舆论风险,还是模型被误解、滥用、传播或不合规使用所引发的任何风险和问题,我们将不承担任何责任。
使用本仓库的源码需要遵循 Apache-2.0 开源协议,使用 XVERSE-MoE-A4.2B-Chat 的模型权重则需要遵循模型许可协议。
XVERSE-MoE-A4.2B-Chat 模型权重对学术研究完全开放,并且支持免费商用。如需申请商业许可证,请填写【申请表】,如有其他问题或合作,请联系 [email protected]。
Like all other Large Language Models (LLMs), XVERSE-MoE-A4.2B-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-MoE-A4.2B-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-MoE-A4.2B-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-MoE-A4.2B-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.
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-MoE-A4.2B-Chat needs to adhere to the Model License Agreement.
The XVERSE-MoE-A4.2B-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 [email protected].