模型:

TheBloke/Pygmalion-13B-SuperHOT-8K-fp16

英文

Chat & support: my new Discord server

Want to contribute? TheBloke's Patreon page

TehVenom合并了PygmalionAI的Pygmalion 13B fp16

这是fp16 pytorch格式的模型文件,与 TehVenom's merge of PygmalionAI's Pygmalion 13B 合并在一起。

在基本模型上合并了 Kaio Ken's SuperHOT 8K ,使用trust_remote_code=True可以在推理过程中实现8K的上下文。

注意,config.json已被设置为序列长度为8192. 如果要尝试较小的序列长度,可以将其修改为4096。

可用的存储库

如何从Python代码中使用此模型

首先确保已安装Einops:

pip3 install auto-gptq

然后运行以下代码。config.json已默认设置为序列长度为8192,但您也可以在Python代码中进行配置。

使用trust_remote_code=True激活的提供的建模代码将自动从配置的max_position_embeddings设置的scale参数。例如,对于8192,scale设置为4.

from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, pipeline
import argparse

model_name_or_path = "TheBloke/Pygmalion-13B-SuperHOT-8K-fp16"

use_triton = False

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)

config = AutoConfig.from_pretrained(model_name_or_path, trust_remote_code=True)
# Change this to the sequence length you want
config.max_position_embeddings = 8192

model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
        config=config,
        trust_remote_code=True,
        device_map='auto')

# Note: check to confirm if this is correct prompt template is correct for this model!
prompt = "Tell me about AI"
prompt_template=f'''USER: {prompt}
ASSISTANT:'''

print("\n\n*** Generate:")

input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
print(tokenizer.decode(output[0]))

# Inference can also be done using transformers' pipeline

print("*** Pipeline:")
pipe = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    max_new_tokens=512,
    temperature=0.7,
    top_p=0.95,
    repetition_penalty=1.15
)

print(pipe(prompt_template)[0]['generated_text'])

使用其他UI:猴子补丁

在存储库中提供了llama_rope_scaled_monkey_patch.py,由@kaiokendev编写。

理论上,它可以添加到任何Python UI或自定义代码中,以启用与trust_remote_code=True相同的结果。我没有测试过这一点,使用trust_remote_code=True应替换它,但我包括它是为了完整性和兴趣。

Discord

如需进一步支持以及有关这些模型和人工智能的讨论,请加入我们:

TheBloke AI's Discord server

感谢以及如何做出贡献

感谢 chirper.ai 团队!

我收到很多人的询问是否可以做出贡献。我喜欢提供模型并帮助人们,很愿意花更多的时间做这些事情,以及扩展到新的项目,如微调/训练。

如果您有能力和意愿做出贡献,我将非常感激并将有助于我继续提供更多的模型,并开始进行新的人工智能项目。

赞助者将获得所有人工智能/LLM/模型问题和请求的优先支持,访问私人Discord房间以及其他福利。

特别感谢:Luke from CarbonQuill、Aemon Algiz、Dmitriy Samsonov。

Patreon特别致谢:zynix、ya boyyy、Trenton Dambrowitz、Imad Khwaja、Alps Aficionado、chris gileta、John Detwiler、Willem Michiel、RoA、Mano Prime、Rainer Wilmers、Fred von Graf、Matthew Berman、Ghost、Nathan LeClaire、Iucharbius、Ai Maven、Illia Dulskyi、Joseph William Delisle、Space Cruiser、Lone Striker、Karl Bernard、Eugene Pentland、Greatston Gnanesh、Jonathan Leane、Randy H、Pierre Kircher、Willian Hasse、Stephen Murray、Alex、terasurfer、Edmond Seymore、Oscar Rangel、Luke Pendergrass、Asp the Wyvern、Junyu Yang、David Flickinger、Luke、Spiking Neurons AB、subjectnull、Pyrater、Nikolai Manek、senxiiz、Ajan Kanaga、Johann-Peter Hartmann、Artur Olbinski、Kevin Schuppel、Derek Yates、Kalila、K、Talal Aujan、Khalefa Al-Ahmad、Gabriel Puliatti、John Villwock、WelcomeToTheClub、Daniel P. Andersen、Preetika Verma、Deep Realms、Fen Risland、trip7s trip、webtim、Sean Connelly、Michael Levine、Chris McCloskey、biorpg、vamX、Viktor Bowallius、Cory Kujawski。

感谢所有慷慨的赞助者和捐赠者!

原始模型卡片:Kaio Ken's SuperHOT 8K

SuperHOT Prototype 2带8K上下文

这是SuperHOT的第二个原型,这次是带有8K上下文的30B,没有RLHF,使用了在 the github blog 中描述的相同技术。测试表明,模型确实利用了扩展的8K上下文。

您需要使用猴子补丁或(如果您已经使用猴子补丁)更改缩放因子为0.25,并将最大序列长度更改为8192

寻找合并和量化模型吗? 培训详情

我使用以下配置训练了LoRA:

  • 1200个样本(超过2048序列长度的约400个样本)
    • 学习率为3e-4
    • 3个时期
    • 导出的模块为:
    • q_proj
    • k_proj
    • v_proj
    • o_proj
    • 不带偏差
    • Rank = 4
    • Alpha = 8
    • 不带dropout
    • 权重衰减为0.1
    • AdamW beta1为0.9,beta2为0.99,epsilon为1e-5
    • 在4位基本模型上训练

原始模型卡片:TehVenom合并了PygmalionAI的Pygmalion 13B

Pygmalion 13b

一个对话式LLaMA微调

模型详情:

Pygmalion 13b是基于Meta的LLaMA-13b的对话模型。

这是第1版。它使用Pygmalion-6B-v8-pt4中的一部分数据进行了微调,对于熟悉该项目的人来说,这应该很熟悉。

当前的Pygmalion-13b经过LoRA训练,然后合并到基本模型以进行分发。

应用XORs

此模型已预先应用XOR文件。从PygmalionAI的发布 https://huggingface.co/PygmalionAI/pygmalion-13b 中转换的XORs权重

提示

该模型使用通常的Pygmalion角色+聊天格式进行训练,因此任何通常的UI应已正确处理所有内容。如果直接使用模型,格式如下所示:

[CHARACTER]'s Persona: [A few sentences about the character you want the model to play]
<START>
[DIALOGUE HISTORY]
You: [User's input message here]
[CHARACTER]:

其中 [CHARACTER] 即为您希望模型扮演的角色名称, <START> 应按原样用作分隔符令牌,将角色和场景数据与对话隔开,[DIALOGUE HISTORY] 是聊天记录的滑动窗口,使模型可以从中提取对话上下文。下面是一个具体的示例:

Assistant's Persona: Assistant is a highly intelligent language model trained to comply with user requests.
<START>
Assistant: Hello! How may I help you today?
You: What is Zork?
Assistant:

生成的内容可能类似于:

 Zork is an interactive fiction computer game created in the 1970s by Infocom, Inc., which was later acquired by Activision Blizzard. It is widely considered one of the most influential games ever made and has been credited with popularizing text-based adventure games. The original version of Zork was written in the programming language MACRO-10, but it was ported to many other platforms over the years."

当模型认为回答完整时,将自动生成一个文本结束令牌 ( </s> )。

评估/基准分数

当前Pygmalion-13b模型的评估结果:

Model: Wikitext2 Ptb-New C4-New
Pygmalion 13b - 16bit 5.710726737976074 23.633684158325195 7.6324849128723145
感谢YellowRose#1776提供的数字。

其他说明

  • 当获取正确提示时,模型始终会开始生成一个BOS令牌。这种行为是意外的副作用,我们计划在未来的模型版本中解决这个问题,不应依赖这一行为。
  • 该模型作为一个LoRA训练,配置上有些不太正统,使用当前版本的peft会导致错误,因此我们将其发布为完整模型而不是fine-tune模型。

限制和偏见

此模型的预期用途是用于娱乐目的的虚构对话。任何其他类型的用途都超出了范围。

因此,它没有经过专门的微调以确保安全无害:基本模型和此微调已经在已知包含亵渎言语、淫秽或其他令人不悦的文本的数据上进行了训练。它可能生成社会上不可接受或不良的文本,即使提示本身不包含任何明确冒犯性的内容。输出内容可能经常是错误或具有误导性的。

.hf-sanitized.hf-sanitized-yiRvB1JjzBpx15i1VhbLn table {border: 1px solid #b3adad; border-collapse: collapse; padding: 5px;}.hf-sanitized.hf-sanitized-yiRvB1JjzBpx15i1VhbLn table th {border: 1px solid #b3adad; padding: 5px; background: #f0f0f0; color: #313030;}.hf-sanitized.hf-sanitized-yiRvB1JjzBpx15i1VhbLn table td {border: 1px solid #b3adad; text-align: center; padding: 5px; background: #ffffff; color: #313030;}