Files
2024-07-26 14:29:53 +00:00

94 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
frameworks:
- Pytorch
license: Apache License 2.0
tasks:
- text-classification
#model-type:
##如 gpt、phi、llama、chatglm、baichuan 等
- llama
#domain:
##如 nlp、cv、audio、multi-modal
- nlp
#language:
##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
- cn
- zh
#metrics:
##如 CIDEr、Blue、ROUGE 等
#- CIDEr
#tags:
##各种自定义,包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
- fine-tuned
#tools:
##如 vllm、fastchat、llamacpp、AdaSeq 等
- vllm
---
# Unichat-llama3.1-Chinese-8B
## 介绍
* 中国联通AI创新中心发布llama3.1中文指令微调模型(全参数微调)
* 使用llama3官方对话模板
* 中文环境下安全和价值观改造
* 模型中文问题回答风格优化
* 基础模型 [**Meta-Llama-3.1-8B-Instruct**](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct)
### 📊 数据
- 高质量指令数据,覆盖多个领域和行业,为模型训练提供充足的数据支持
- 微调指令数据经过严格的人工筛查,保证优质的指令数据用于模型微调
## 问答示例
- 问:曼谷的大皇宫与卧佛寺,哪个玩起来更有意思?
- 答:在探讨曼谷的大皇宫与卧佛寺哪个更有趣时,我们可以从多个维度进行分析。
首先大皇宫Grand Palace是曼谷最著名的景点之一以其宏伟的建筑和丰富的历史文化价值而闻名。游客可以在这里参观到许多珍贵的艺术品和文物同时了解泰国的历史和传统。此外大皇宫还举办了许多重要的活动如王室婚礼等这为游客提供了独特的视觉体验。
另一方面卧佛寺Wat Pho则以其庞大的金色佛像而受到游客的喜爱。这座寺庙不仅是一个宗教场所也是一个休闲娱乐的地方。游客可以在这里欣赏美丽的佛像、享受按摩服务还可以购买一些特色纪念品。同时卧佛寺周边还有许多小吃摊位供游客品尝当地美食。
总的来说,大皇宫和卧佛寺各有千秋。大皇宫更注重历史文化的展示和教育,而卧佛寺则更侧重于宗教信仰和休闲娱乐。如果你对泰国的历史和文化感兴趣,那么大皇宫可能会让你更加满意;如果你希望在旅行中放松身心,并体验一下当地的宗教氛围,那么卧佛寺可能会是你的首选。
因此,选择哪个更有意思取决于个人兴趣和偏好。如果时间允许,建议两者都去一趟,以便全面领略曼谷的魅力。
## 运行代码
```python
import transformers
import torch
model_id = "UnicomAI/Unichat-llama3.1-Chinese-8B"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "你是谁?"},
]
outputs = pipeline(
messages,
max_new_tokens=1024,
do_sample=False,
repetition_penalty=1.1,
)
print(outputs[0]["generated_text"][-1])
```
## 资源
更多模型,数据集和训练相关细节请参考:
* Github[**Unichat-llama3-Chinese**](https://github.com/UnicomAI/Unichat-llama3-Chinese)