Ocean-Coder-7B-Fusion
A hybrid coding and general-purpose AI assistant
2 min read
This model combines the weights of two popular Alibaba models using SLERP: the coding-focused Qwen2.5-Coder-7B-Instruct and the general-purpose Qwen2.5-7B-Instruct. No additional fine-tuning or training on new data was performed during creation; instead, the base model weights were merged tensor by tensor. The result is a 7.6B parameter language model (LLM) that retains strong coding skills while handling general instructions, English, and German tasks better.
Key features
- Built on the Qwen2 architecture (28 layers, hidden size 3584).
- Uses spherical linear interpolation (SLERP) with varying coefficients for attention layers and multi-layer perceptrons (MLPs).
- Supports tasks in English and German.
- Ships with default generation settings from OceanLabs and a standard ChatML prompt template.
What you can do
- Write, refactor, and debug code across various programming languages.
- Get detailed explanations of code snippets and algorithms.
- Use it as a local assistant for everyday general-purpose tasks.
- Experiment with pre-built models created via weight merging.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "OceanLabs/Ocean-Coder-7B-Fusion"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Schreibe eine Python-Funktion, die prüft, ob ein String ein Palindrom ist."}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Read more
DetailsHardware requirements: roughly 15 GB of VRAM in bfloat16 format.
Requires the transformers library version 4.37 or higher.
Benchmarks and official evaluations were not conducted at the time of release.
License: Apache 2.0.










Comments