Text Generation
Transformers
Safetensors
Basque
English
Spanish
mamba2
mamba-2
basque
autocomplete
fim
fill-in-the-middle
ghost-text
continued-pretraining
low-resource
Run this model with HF Jobs
Run itzune/morpheus-fim on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/itzune/morpheus-fim. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/itzune/morpheus-fim on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/itzune/morpheus-fim. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/itzune/morpheus-fim. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use itzune/morpheus-fim with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use itzune/morpheus-fim with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="itzune/morpheus-fim")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("itzune/morpheus-fim") model = AutoModelForCausalLM.from_pretrained("itzune/morpheus-fim", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use itzune/morpheus-fim with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "itzune/morpheus-fim" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itzune/morpheus-fim", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/itzune/morpheus-fim
- SGLang
How to use itzune/morpheus-fim with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "itzune/morpheus-fim" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itzune/morpheus-fim", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "itzune/morpheus-fim" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itzune/morpheus-fim", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use itzune/morpheus-fim with Docker Model Runner:
docker model run hf.co/itzune/morpheus-fim
Upload README.md with huggingface_hub
Browse files47 unmodified lines4849505152535419 unmodified lines7475767778798081828384858687888990919247 unmodified lines| Learning rate | 1.0e-3, cosine decay, ~3,815 steps || Tokenizer | `basque_unigram_fim.model` (original 4000 + 4 FIM tokens) |The 70/30 ratio + 5Γ `<EOT>` weight was selected after a senior ML engineering review of the v2 failure mode (unreliable stop-token emission β over-generation).## FIM Token Format19 unmodified linesFIM eval on 147 held-out examples (token-level splits, 20% at linguistic boundaries):| Metric | v2 (50/50, no EOT weight) | **v3 (70/30, 5Γ EOT weight)** ||--------|---------------------------|-------------------------------|| `<EOT>` emission rate | 76.9% | **88.4%** || Keystrokes saved | β25.2% | **β5.9%** || Exact-match rate | 2.7% | **6.8%** || Avg char accuracy | 31.2% | **32.3%** || Avg gen length (ref=45.0) | 56.8 (over-gen) | **40.3** || Prefix truncation (overall) | 0.0% | **1.4%** || β long-bucket truncation | 0.0% | **2.3%** (< 15% threshold) || AR valid PPL | 7.4 | **7.5** (stable) || FIM valid PPL | 8.0 | **7.9** |The 5Γ `<EOT>` loss weighting worked as designed: emission reliability rose 77% β 88%, over-generation collapsed (56.8 β 40.3 chars vs. 45.0 target), and the feared premature-truncation failure mode did not materialize (1.4% overall, 2.3% long-bucket β far below the 15% threshold).## Usage47 unmodified lines4849505152535419 unmodified lines7475767778798081828384858687888990919247 unmodified lines| Learning rate | 1.0e-3, cosine decay, ~3,815 steps || Tokenizer | `basque_unigram_fim.model` (original 4000 + 4 FIM tokens) |The 70/30 ratio + 5Γ `<EOT>` weight directly target the FIM stop-token reliability problem: the model must learn not just *what* to generate but *when to stop*, and the `<EOT>` signal is otherwise too sparse (one token per example) within a 500M-token budget for the model to reliably emit it.## FIM Token Format19 unmodified linesFIM eval on 147 held-out examples (token-level splits, 20% at linguistic boundaries):| Metric | Result ||--------|--------|| `<EOT>` emission rate | 88.4% || Keystrokes saved | β5.9% || Exact-match rate | 6.8% || Avg char accuracy | 32.3% || Avg generation length (ref=45.0) | 40.3 || Prefix truncation (overall) | 1.4% || β long-bucket truncation | 2.3% (< 15% threshold) || AR valid PPL | 7.5 || FIM valid PPL | 7.9 |The 5Γ `<EOT>` loss weighting resolves the over-generation failure mode: `<EOT>` emission reaches 88.4% and generation length (40.3) sits near the 45.0-char reference, yielding near-break-even keystrokes saved (β5.9%). The feared premature-truncation failure mode β the dual risk of over-weighting the stop token β did not materialize (1.4% overall, 2.3% long-bucket, far below the 15% threshold). AR perplexity remained stable (7.5 vs. 7.13 AR-only base), confirming the 70/30 FIM ratio did not trade away AR capability.## Usage
README.md+14-14