Text Generation
PEFT
Safetensors
English
Pytorch
Transformers
Mistral
LoRA
QloRA
code-generation
ML
conversational
Instructions to use Raspberry-Pie/Hot-Coco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Raspberry-Pie/Hot-Coco with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2") model = PeftModel.from_pretrained(base_model, "Raspberry-Pie/Hot-Coco") - Notebooks
- Google Colab
- Kaggle
π₯€ Hot Coco: Grab a Hot Coco and Start Coding
Never train an AI model again. Hot Coco is your personal, on-demand expert for PyTorch, Hugging Face Transformers, and Machine Learning.
Built on Mistral-7B and fine-tuned with QLoRA, Hot Coco skips the fluff and gets straight to the code. Whether you are debugging a CUDA error or architecting a new Transformer, just grab a Hot Coco and start coding.
π Why Hot Coco?
- π― Specialized Expertise: Trained exclusively on high-quality PyTorch and ML data.
- β‘ Lightweight & Fast: Uses 4-bit quantization (QLoRA) to run smoothly on consumer hardware.
- π§ Long Context: Handles up to 32k tokens, perfect for pasting entire scripts for debugging.
- π Private & Secure: Keep your proprietary code safe by running it locally.
π οΈ Quick Start
1. Install Dependencies
pip install transformers peft accelerate bitsandbytes torch
2. Load Hot Coco
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
from huggingface_hub import login
# Authenticate for private repo access
login(token="YOUR_HF_TOKEN")
base_model_id = "mistralai/Mistral-7B-Instruct-v0.2"
adapter_id = "Raspberry-Pie/Hot-Coco"
# Configure 4-bit loading for efficiency
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=bnb_config,
device_map="auto"
)
# Merge Hot Coco's expertise
model = PeftModel.from_pretrained(base_model, adapter_id)
3. Start Coding
prompt = "<s>[INST] Write a PyTorch training loop with gradient clipping. [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Training Details
- Base: Mistral-7B-Instruct-v0.2
- Method: QLoRA (4-bit NF4)
- Data: 1,800 curated examples from CodeAlpaca + Custom Identity Injection
- Hardware: Trained on Kaggle T4 x2 GPUs
Built with β€οΈ by Raspberry-Pie
- Downloads last month
- 66
Model tree for Raspberry-Pie/Hot-Coco
Base model
mistralai/Mistral-7B-Instruct-v0.2