license: other
license_name: deepseek-coder-33b
license_link: https://huggingface.co/deepseek-ai/deepseek-coder-33b-base/blob/main/LICENSE
三位一体

三位一体是一款通用编程人工智能。Trinity-33B-v1.0版本在HumanEval测试中达到70分。
我们的进攻性网络安全模型WhiteRabbitNeo-33B-v1.2现已进入测试阶段!
体验提示增强功能!访问地址:https://www.whiterabbitneo.com/
加入我们的Discord社区
加入链接:https://discord.gg/8Ynkrcbk92 (2023年12月29日更新,永久有效邀请链接)
使用条款
当您访问并使用本人工智能(AI)模型时,即表示您确认并同意:您将独自承担使用该模型及其产生结果的全部责任。您在此同意赔偿、辩护并使本AI模型的创作者、开发者及相关个人或实体免受因使用该模型直接或间接产生的一切索赔、责任、损害、损失、成本、费用(包括合理律师费及诉讼费用)的影响。
本AI模型按"现状"和"可用性"提供,不作任何明示或暗示的保证,包括但不限于对适销性、特定用途适用性及不侵权的保证。创作者不保证该AI模型能满足您的需求,或保证其持续可用、安全或无错误。
您使用该AI模型的风险和判断完全由您自行承担,对于因使用该AI模型导致的计算机系统损坏或数据丢失,您将承担全部责任。
本免责声明构成您与AI模型创作者之间关于使用该模型的协议组成部分,并取代先前您与创作者之间关于使用本AI模型的任何协议。
示例推理代码
import torch, json
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "/home/migel/models/Trinity"
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.float16,
device_map="auto",
load_in_4bit=False,
load_in_8bit=True,
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
def generate_text(instruction):
tokens = tokenizer.encode(instruction)
tokens = torch.LongTensor(tokens).unsqueeze(0)
tokens = tokens.to("cuda")
instance = {
"input_ids": tokens,
"top_p": 1.0,
"temperature": 0.5,
"generate_len": 1024,
"top_k": 50,
}
length = len(tokens[0])
with torch.no_grad():
rest = model.generate(
input_ids=tokens,
max_length=length + instance["generate_len"],
use_cache=True,
do_sample=True,
top_p=instance["top_p"],
temperature=instance["temperature"],
top_k=instance["top_k"],
num_return_sequences=1,
)
output = rest[0][length:]
string = tokenizer.decode(output, skip_special_tokens=True)
answer = string.split("USER:")[0].strip()
return f"{answer}"