Downloads · 30 days
20
47% of all-time downloads
fage13141/zhenhuantimodel
zhenhuantimodel is a machine learning model from fage13141. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
这是一个基于 DeepSeek-7B-Chat 模型微调的甄嬛主题聊天助手。模型具有以下特点:
Downloads · 30 days
20
47% of all-time downloads
All-time downloads
43
Public
Parameters
6.9B
13.8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors13.8 GB · 100%
From the Hugging Face model README
这是一个基于 DeepSeek-7B-Chat 模型微调的甄嬛主题聊天助手。模型具有以下特点:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# 加载模型和tokenizer
model = AutoModelForCausalLM.from_pretrained(
"fage13141/zhenhuantimodel",
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"fage13141/zhenhuantimodel",
use_fast=True,
trust_remote_code=True
)
# 开始对话
messages = [{"role": "user", "content": "你好,嬛嬛"}]
input_text = tokenizer.apply_chat_template(messages, tokenize=False)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("Assistant:")[-1].strip())
git lfs install
git clone https://huggingface.co/fage13141/zhenhuantimodel
model_path = "./zhenhuantimodel"
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
local_files_only=True
)
Apache 2.0