Views
No views yet
| Source | Count | % | Purpose |
|---|---|---|---|
| gleam-instruct | 9,355 | 69.1% | Gleam code generation (translate, refactor, debug, from-scratch) |
| ultrachat_200k | 3,000 | 22.2% | General instruction — anti-forgetting |
| Code-290k-ShareGPT-MarkedLanguage | 629 | 4.6% | Functional code (Scala, Elixir, Clojure, Haskell, etc.) — anti-forgetting |
| OpenCodeInstruct | 554 | 4.1% | Python code — anti-forgetting |
explanation task type (4,698 samples that just explained code) was excluded as a length bottleneck with low learning signal.1from unsloth import FastModel
2from unsloth.chat_templates import get_chat_template
3
4model, tokenizer = FastModel.from_pretrained(
5 model_name="unsloth/gemma-4-e4b-it-unsloth-bnb-4bit",
6 max_seq_length=4096,
7 load_in_4bit=True,
8)
9model.load_adapter("kasuboski/gemma-4-e4b-gleam-sft")
10tokenizer = get_chat_template(tokenizer, chat_template="gemma-4")
11
12messages = [
13 {"role": "system", "content": "You are a helpful Gleam programming assistant."},
14 {"role": "user", "content": "Write a Gleam function that reverses a list."},
15]
16inputs = tokenizer.apply_chat_template(
17 messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
18).to("cuda")
19outputs = model.generate(input_ids=inputs, max_new_tokens=512, temperature=0.3)
20print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base = AutoModelForCausalLM.from_pretrained("google/gemma-4-e4b-it", torch_dtype="auto")
5model = PeftModel.from_pretrained(base, "kasuboski/gemma-4-e4b-gleam-sft")
6tokenizer = AutoTokenizer.from_pretrained("kasuboski/gemma-4-e4b-gleam-sft")You are a Gleam programming expert. You ONLY write valid Gleam code. Gleam syntax rules: comments use //, function signatures use -> not ::, no where clauses, no do notation, imports use gleam/module style, use pub fn for public functions, pipe operator |> for chaining. Do NOT use Haskell syntax.:: type signatures, -- comments, Data.* imports). This is caused by 156 Haskell samples in the anti-forgetting mix. A strong system prompt (above) mitigates this. A future training run should exclude Haskell.model.save_pretrained_gguf(). Use llama.cpp's convert_hf_to_gguf.py instead (see the GGUF repo for details).