Views
No views yet

1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load model and tokenizer
5model_name = "subsectmusic/riko-qwen3-7b"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype=torch.float16,
10 device_map="auto"
11)1# Pull the GGUF model for Ollama
2ollama pull subsectmusic/riko-qwen3-7b
3
4# Start chatting with Riko
5ollama run subsectmusic/riko-qwen3-7b1prompt_template = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
2
3### Instruction:
4You are Riko, respond as the tsundere kitsune AI with your usual personality.
5
6### Input:
7{user_message}
8
9### Response:
10"""
11
12# Generate response
13user_input = "Hello Riko, how are you today?"
14prompt = prompt_template.format(user_message=user_input)
15
16inputs = tokenizer(prompt, return_tensors="pt")
17with torch.no_grad():
18 outputs = model.generate(
19 **inputs,
20 max_new_tokens=256,
21 temperature=0.8,
22 top_p=0.9,
23 do_sample=True,
24 pad_token_id=tokenizer.eos_token_id
25 )
26
27response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
28print(f"Riko: {response}")1Training Framework: Unsloth + TRL SFTTrainer
2Batch Size: 2 (per device)
3Gradient Accumulation: 4 steps
4Learning Rate: 2e-4
5Optimizer: AdamW 8-bit
6Weight Decay: 0.01
7Scheduler: Linear
8Max Steps: 100+
9Warmup Steps: 5
10Sequence Length: Dynamic (up to context limit)| Attribute | Details |
|---|---|
| Architecture | Qwen3 Transformer |
| Parameters | 7b (4-bit quantized) |
| Source Models | Kimi K2 + Horizon Beta (alternating) |
| Project | Project Horizon LLM |
| Context Length | Model dependent |
| Quantization | 4-bit BNB |
| Format Support | PyTorch, GGUF (Ollama compatible) |
| Framework | PyTorch + Transformers |
| Optimization | Unsloth accelerated |
| Training Method | Turn-based alternating between two high-quality models |
1generation_config = {
2 "max_new_tokens": 256,
3 "temperature": 0.8, # Balanced creativity
4 "top_p": 0.9, # Focused sampling
5 "top_k": 50, # Vocabulary limiting
6 "repetition_penalty": 1.1, # Reduce repetition
7 "do_sample": True, # Enable sampling
8 "pad_token_id": tokenizer.eos_token_id
9}1@model{riko-qwen3-7b,
2 title={Riko-Qwen3-7b: Tsundere Kitsune AI},
3 author={subsectmusic},
4 year={2025},
5 publisher={Hugging Face},
6 url={https://huggingface.co/subsectmusic/riko-qwen3-7b}
7}1# Install Ollama
2curl -fsSL https://ollama.ai/install.sh | sh
3
4# Run Riko locally
5ollama pull subsectmusic/riko-qwen3-7b
6ollama run subsectmusic/riko-qwen3-7b "Hello Riko!"