Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
ChatYuan: Large Language Model for Dialogue in Chinese and English
| Date | Stars |
|---|---|
| 2026-07-31 | 1866 |
| 2026-08-04 | 1866 |
| 2026-08-06 | 1866 |
| 2026-08-13 | 1864 |
| 2026-08-18 | 1864 |
| 2026-08-20 | 1863 |
| 2026-09-03 | 1862 |
| 2026-09-04 | 1863 |
| 2026-09-14 | 1864 |
| 2026-09-15 | 1863 |
| 2026-09-18 | 1862 |
| 2026-09-20 | 1862 |
Today
— stars today
This week
-1 stars this week
This month
-1 stars this month
Momentum
0.0
growth rate 0.00%/day
# ChatYuan: Large Language Model for Dialogue in Chinese and English
发布于:2023年3月23日
## 相关介绍
ChatYuan-large-v2是一个支持中英双语的功能型对话语言大模型。ChatYuan-large-v2使用了和 v1版本相同的技术方案,在微调数据、人类反馈强化学习、思维链等方面进行了优化。
ChatYuan large v2 is an open-source large language model for dialogue, supports both Chinese and English languages, and in ChatGPT style.
ChatYuan-large-v2是ChatYuan系列中以轻量化实现高质量效果的模型之一,用户可以在消费级显卡、 PC甚至手机上进行推理(INT4 最低只需 400M )。
<a href='https://huggingface.co/spaces/ClueAI/ChatYuan-large-v2' target="__blank">在线Demo(Huggingface)</a> |
<a href='https://modelscope.cn/studios/ClueAI/ChatYuan-large-v2' target="__blank">在线Demo(ModelScope)</a> |
<a href='https://www.clueai.cn' target="__blank">使用API(large版)</a> |
<a href='https://colab.research.google.com/drive/1ZcLIJuemiojigrfjbsDMBWrX7JqXZX6I?usp=sharing' target="__blank">Colab在线试用</a> |
<a href='https://mp.weixin.qq.com/s/FtXAnrhavA5u7hRyfm8j6Q' target="__blank">文章介绍</a>
在chatyuan-large-v1的原有功能的基础上,我们给模型进行了如下优化:
- 增强了基础能力。原有上下文问答、创意性写作能力明显提升。
- 新增了拒答能力。对于一些危险、有害的问题,学会了拒答处理。
- 新增了中英双语对话能力。
- 新增了代码生成功能。对于基础代码生成进行了一定程度优化。
- 新增了表格生成功能。使生成的表格内容和格式更适配。
- 增强了基础数学运算能力。
- 最大长度从1024token数扩展到4096。
- 增强了模拟情景能力。
Based on the original functions of Chatyuan-large-v1, we optimized the model as follows:
-Added the ability to speak in both Chinese and English.
-Added the ability to refuse to answer. Learn to refuse to answer some dangerous and harmful questions.
-Added code generation functionality. Basic code generation has been optimized to a certain extent.
-Enhanced basic capabilities. The original contextual Q&A and creative writing skills have significantly improved.
-Added a table generation function. Make the generated table content and format more appropriate.
-Enhanced basic mathematical computing capabilities.
-The maximum number of length tokens has been expanded to 4096.
-Enhanced ability to simulate scenarios< br>
## 模型下载与体验地址
https://huggingface.co/ClueAI/ChatYuan-large-v2/
https://modelscope.cn/studios/ClueAI/ChatYuan-large-v2
## 声明
文本由模型生成的结果, 请谨慎辨别和参考, 不代表任何人观点
请在法律允许的范围内使用,详见[LICENSE](./LICENSE)
<a href='https://www.cluebenchmarks.com/clueai.html'>PromptCLUE-large</a>在1000亿token中文语料上预训练,累计学习1.5万亿中文token,并且在数百种任务上进行Prompt任务式训练。针对理解类任务,如分类、情感分析、抽取等,可以自定义标签体系;针对多种生成任务,可以进行采样自由生成。
<a href='https://huggingface.co/spaces/ClueAI/ChatYuan-large-v2' target="__blank">在线Demo huggingface space </a> |
<a href='https://www.clueai.cn' target="__blank">使用API(large版)</a> |
<a href='https://github.com/clue-ai/ChatYuan' target="__blank">Github项目地址</a> |
<a href='https://colab.research.google.com/drive/1ZcLIJuemiojigrfjbsDMBWrX7JqXZX6I?usp=sharing' target="__blank">Colab在线试用</a> |
<a href='https://mp.weixin.qq.com/s/-axa6XcjGl_Koeq_OrDq8w' target="__blank">文章介绍</a>
#### 代码范例
- 一键启动gradio网页交互,对话

为确保可以正常运行,提供一种依赖配置
clueai==0.0.2.2.4
gradio==3.20.1
transformers==4.26.1
直接运行 app_gradio.py即可,打开
- 本地调试
### 简洁对话方式
```python
from transformers import AutoTokenizer, AutoModel
import os
model_dir='ClueAI/ChatYuan-large-v2'
tokenizer = AutoTokenizer.from_pretrained(model_dir)
# 速度会受到网络影响,网络不好可以使用下面高级参数配置方式
model = AutoModel.from_pretrained(model_dir, trust_remote_code=True)
history = []
print("starting")
while True:
query = input("\n用户:")
if query == "stop":
break
if query == "clear":
history = []
os.system('clear')
continue
response, history = model.chat(tokenizer, query, history=history)
print(f"小元:{response}")
```
### 高级参数配置方式
加载模型:
```python
# 加载模型
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("ClueAI/ChatYuan-large-v2")
model = T5ForConditionalGeneration.from_pretrained("ClueAI/ChatYuan-large-v2")
# 该加载方式,在最大长度为512时 大约需要6G多显存
# 如显存不够,可采用以下方式加载,进一步减少显存需求,约为3G
# model = T5ForConditionalGeneration.from_pretrained("ClueAI/ChatYuan-lExcerpt of 16,136 characters
Read on GitHubbrightmart · https://www.CLUEbenchmarks.com · China
36
matrix
33
12
thomas-yanxin · @Cylingo-Team @X-D-Lab
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:69d1048c16a2c613, llm:Repository description: 'ChatYuan: Large Language Model for Dialogue in Chinese and English' (Python).
matched fp:69d1048c16a2c613, llm:Repository description: 'ChatYuan: Large Language Model for Dialogue in Chinese and English' (Python).
matched fp:69d1048c16a2c613, llm:Repository description: 'ChatYuan: Large Language Model for Dialogue in Chinese and English' (Python).