介绍
猫娘聊天模型,Qwen3-1.7B在猫娘数据集微调版本
示例
https://huggingface.co/spaces/xcczach/Qwen3-1.7B-xiro-neko-Demo
快速开始
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "xcczach/Qwen3-1.7B-xiro-neko"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name, dtype="auto", device_map="auto"
)
# prepare the model input
prompt = "你是谁呀"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True, # Switches between thinking and non-thinking modes. Default is True.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# conduct text completion
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :].tolist()
# parsing thinking content
try:
# rindex finding 151668 (</think>)
index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
index = 0
thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip(
"\n"
)
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print("thinking content:", thinking_content)
print("content:", content)
Introduction
A catgirl-themed chat model — a fine-tuned version of Qwen3-1.7B trained on the Catgirl Dataset.
Example
https://huggingface.co/spaces/xcczach/Qwen3-1.7B-xiro-neko-Demo
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "xcczach/Qwen3-1.7B-xiro-neko"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name, dtype="auto", device_map="auto"
)
# prepare the model input
prompt = "Who are you?"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True, # Switches between thinking and non-thinking modes. Default is True.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# conduct text completion
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :].tolist()
# parsing thinking content
try:
# rindex finding 151668 (</think>)
index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
index = 0
thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip(
"\n"
)
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print("thinking content:", thinking_content)
print("content:", content)
- Downloads last month
- 8