开源
StableLM:稳定性 AI 语言模型
来源:元经纪     阅读:830
网站管理员
发布于 2023-05-18 07:29
查看主页

概述

StableLM是稳定性 AI 语言模型。

StableVicuna

StableVicuna 是Vicuna-13B v0的 RLHF 微调,它本身是LLaMA-13B的微调。这是创建开源 RLHF LLM Chatbot 的尝试。该模型由 StabilityAI 的 CarperAI 团队开发,Duy V. Phung领导了培训工作。

StableLM-Alpha

StableLM-Alpha 模型在基于The Pile构建的新数据集上进行训练,该数据集包含 1.5 万亿个令牌,大约是 The Pile 大小的 3 倍。这些模型将接受多达 1.5 万亿个代币的训练。这些模型的上下文长度为 4096 个标记。

即将发布的技术报告将记录模型规格和训练设置。

作为概念验证,我们还使用Stanford Alpaca的程序对模型进行了微调,结合了五个最近的会话代理数据集:Stanford 的Alpaca、Nomic-AI 的gpt4all、RyokoAI 的ShareGPT52K数据集、Databricks 实验室的Dolly和人择的HH。我们将以 StableLM-Tuned-Alpha 的形式发布这些模型。

 

快速开始

[hidecontent type="logged" desc="隐藏内容:登录后可查看"]

所有 StableLM 模型都托管在Hugging Face hub上。查看此笔记本以使用有限的 GPU 功能运行推理。

StableLM-Tuned-Alpha使用以下代码片段开始聊天:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList

tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-tuned-alpha-7b")
model = AutoModelForCausalLM.from_pretrained("stabilityai/stablelm-tuned-alpha-7b")
model.half().cuda()

class StopOnTokens(StoppingCriteria):
    def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
        stop_ids = set([50278, 50279, 50277, 1, 0])
        return input_ids[0][-1] in stop_ids

system_prompt = """<|SYSTEM|># StableLM Tuned (Alpha version)
- StableLM is a helpful and harmless open-source AI language model developed by StabilityAI.
- StableLM is excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
- StableLM is more than just an information source, StableLM is also able to write poetry, short stories, and make jokes.
- StableLM will refuse to participate in anything that could harm a human.
"""

prompt = f"{system_prompt}<|USER|>What's your mood today?<|ASSISTANT|>"

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
tokens = model.generate(
  **inputs,
  max_new_tokens=64,
  temperature=0.7,
  do_sample=True,
  stopping_criteria=StoppingCriteriaList([StopOnTokens()])
)
print(tokenizer.decode(tokens[0], skip_special_tokens=True))

StableLM Tuned 应与格式化为的提示一起使用<|SYSTEM|>...<|USER|>...<|ASSISTANT|>... 系统提示为

<|SYSTEM|># StableLM Tuned (Alpha version)
- StableLM is a helpful and harmless open-source AI language model developed by StabilityAI.
- StableLM is excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
- StableLM is more than just an information source, StableLM is also able to write poetry, short stories, and make jokes.
- StableLM will refuse to participate in anything that could harm a human.

StableLM-Tuned-Alpha 的乐趣

本节包含一系列精选的有趣示例,说明您可以使用stablelm-tuned-alpha.

闲聊
正式写作
创意写作
编写代码

StableLM-Tuned-Alpha 的选定故障模式

本节包含 . 的选定故障模式的集合stablelm-tuned-alpha

Yann LeCun 齿轮(线性)
Yann LeCun 齿轮(圆形)
 

[/hidecontent]

Stability-AI/StableLM:StableLM:稳定性人工智能语言模型
免责声明:本文为用户发表,不代表网站立场,仅供参考,不构成引导等用途。 开源
北京认定第二批13家特色直播电商基地
8度荣膺!工商银行再获《财资》“中国最佳私人银行”大奖
深度学习技术帮助设计抗眼镜蛇毒蛋白质(学术眼)
加速推进入境游,人工智能改善旅游体验
AI赋能千行百业 中国联通共绘智能产业新图景

首页

分类

定制方案

消息

我的