魔搭社区每周速递(6.28-7.12)
魔搭ModelScope本周带来:
13个模型:包括:百川13B模型、百川13B对话模型、rwkv-4-world、internlm-chat-7b等;
8个数据集:图像分类、多语言、文本生成图片等;
4个创新应用:ModelScope GPT、百川13B对话Demo、微调扩散模型、RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096 三号空间;
4篇文章:生成式AI时代的AI Infra—从DevOps->MLOps->LLMOps、48小时Hackathon,见证新生代AI创新的发生 | 魔搭AI Hackathon编程大赛、百川13B模型发布及魔搭最佳实践、国内首发,百川13B大模型上架魔搭;
百川13B模型
Baichuan-13B 是由百川智能继 Baichuan-7B 之后开发的包含 130 亿参数的开源可商用的大规模语言模型,在权威的中文和英文 benchmark 上均取得同尺寸最好的效果。
示例代码
from modelscope.utils.constant import Tasks
from modelscope.pipelines import pipeline
import torch
from modelscope import snapshot_download, Model
model_dir = snapshot_download("baichuan-inc/Baichuan-13B-Base", revision='v1.0.1')
model = Model.from_pretrained(model_dir, device_map="balanced", trust_remote_code=True, torch_dtype=torch.float16)
text_generation_zh = pipeline(task=Tasks.text_generation, model=model)
text_generation_zh._model_prepare = True
result_zh = text_generation_zh('今天天气是真的', min_length=10, max_length=512, num_beams=3,temperature=0.8,do_sample=False, early_stopping=True,top_k=50,top_p=0.8, repetition_penalty=1.2, length_penalty=1.2, no_repeat_ngram_size=6)
print(result_zh)
internlm-chat-7b
InternLM ,即书生·浦语大模型,包含面向实用场景的70亿参数基础模型与对话模型 (InternLM-7B)。模型具有以下特点:
-
使用上万亿高质量预料,建立模型超强知识体系;
-
支持8k语境窗口长度,实现更长输入与更强推理体验;
-
通用工具调用能力,支持用户灵活自助搭建流程;
提供了支持模型预训练的轻量级训练框架,无需安装大量依赖包,一套代码支持千卡预训练和单卡人类偏好对齐训练,同时实现了极致的性能优化,实现千卡训练下近90%加速效率。
通过 Transformers 加载
>>> from transformers import AutoTokenizer, AutoModelForCausalLM
>>> tokenizer = AutoTokenizer.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True)
>>> model = AutoModelForCausalLM.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True).cuda()
>>> model = model.eval()
>>> response, history = model.chat(tokenizer, "你好", history=[])
>>> print(response)
你好!有什么我可以帮助你的吗?
>>> response, history = model.chat(tokenizer, "请提供三个管理时间的建议。", history=history)
>>> print(response)
当然可以!以下是三个管理时间的建议:
1. 制定计划:制定一个详细的计划,包括每天要完成的任务和活动。这将有助于您更好地组织时间,并确保您能够按时完成任务。
2. 优先级:将任务按照优先级排序,先完成最重要的任务。这将确保您能够在最短的时间内完成最重要的任务,从而节省时间。
3. 集中注意力:避免分心,集中注意力完成任务。关闭社交媒体和电子邮件通知,专注于任务,这将帮助您更快地完成任务,并减少错误的可能性。
精选应用推荐
ModelScope GPT
链接:https://modelscope.cn/studios/damo/ModelScopeGPT/summary
介绍:智能工具ModelScopeGPT(魔搭GPT),它能接收用户指令,通过“中枢模型”一键调用魔搭社区其他的AI模型,大小模型协同完成复杂任务。
百川13B对话demo
链接:https://modelscope.cn/studios/baichuan-inc/Baichuan-13B-Chatdemo/summary
介绍:Baichuan-13B-Chat为Baichuan-13B系列模型中对齐后的版本,预训练模型可见Baichuan-13B-Base。
RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096 三号空间
链接:https://modelscope.cn/studios/BlinkDL/RWKV-CHN-PRO/summary
介绍:RWKV语言模型(用纯100%RNN达到GPT能力,甚至更强)。模型介绍:https://rwkv.com 在自己电脑玩:https://github.com/josStorer/RWKV-Runner
微调扩散模型
链接:https://modelscope.cn/studios/AI-ModelScope/finetune_stable_diffusion/summary
更多推荐
所有评论(0)