🚀 Trinity
Trinity 是一款通用的編碼人工智能。Trinity-33B-v1.0 在 HumanEval 測試中取得了 70 分的成績。
✨ 主要特性
- 高性能編碼:Trinity 作為通用編碼 AI,在 HumanEval 測試中表現出色,Trinity-33B-v1.0 達到 70 分。
- 進攻性網絡安全模型:旗下的進攻性網絡安全模型 WhiteRabbitNeo - 33B - v1.2 已進入測試階段,具備提示增強功能。
📦 安裝指南
文檔未提供安裝步驟,暫不展示。
💻 使用示例
基礎用法
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}"
conversation = f"SYSTEM: You are an AI that can code. Answer with code."
while True:
user_input = input("You: ")
llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
answer = generate_text(llm_prompt)
print(answer)
conversation = f"{llm_prompt}{answer}"
json_data = {"prompt": user_input, "answer": answer}
📚 詳細文檔
進攻性網絡安全模型試用
我們的進攻性網絡安全模型 WhiteRabbitNeo - 33B - v1.2 目前處於測試階段!你可以查看其提示增強功能,訪問地址:https://www.whiterabbitneo.com/
加入 Discord 服務器
歡迎加入我們的 Discord 服務器,鏈接:https://discord.gg/8Ynkrcbk92 (12 月 29 日更新,現為永久加入鏈接)
使用條款
當你訪問並使用此人工智能(AI)模型時,你作為用戶,需承認並同意你需獨自對你使用該模型及其產生的結果負責。你特此同意賠償、辯護並使此 AI 模型的創建者、開發者以及任何關聯人員或實體免受因你使用該 AI 模型而直接或間接產生的任何及所有索賠、責任、損害、損失、成本、費用(包括合理的律師費和訴訟費)。
此 AI 模型按“原樣”和“現有狀態”提供,不提供任何形式的明示或暗示保證,包括但不限於適銷性、特定用途適用性和不侵權的保證。創建者不保證該 AI 模型將滿足你的要求,或能在不間斷、安全或無錯誤的基礎上使用。
你使用該 AI 模型需自行承擔風險和責任,並且你將獨自對因使用該 AI 模型而導致的計算機系統損壞或數據丟失負責。
本免責聲明構成你與該 AI 模型創建者就你使用該模型達成的協議的一部分,取代你與創建者之前就使用此 AI 模型達成的任何協議。
📄 許可證