Ocean-Coder-7B

EN: The weights in this repo are unchanged Qwen/Qwen2.5-Coder-7B-Instruct (Apache 2.0). No training or fine-tuning was performed. OceanLabs changed only the default system prompt (in the chat template), the generation defaults and the documentation.

DE: Die Gewichte sind unverändert Qwen/Qwen2.5-Coder-7B-Instruct (Apache 2.0). Es wurde nichts trainiert oder feinabgestimmt. OceanLabs hat nur den Standard-Systemprompt (im Chat-Template), die Generierungs-Standardwerte und die Doku angepasst.

EN: Ocean-Coder-7B is OceanLabs' coding assistant for code generation, debugging, refactoring and code explanation, with a default system prompt focused on correct, secure and readable code.

DE: Ocean-Coder-7B ist der Coding-Assistent von OceanLabs für Code-Erzeugung, Debugging, Refactoring und Code-Erklärungen, mit einem Standard-Systemprompt für korrekten, sicheren und lesbaren Code.

What OceanLabs changed / Was OceanLabs geändert hat

File / Datei Change / Änderung
chat_template.jinja, tokenizer_config.json Default system prompt / Standard-Systemprompt: Ocean-Coder
generation_config.json temperature 0.4, top_p 0.9, top_k 20, repetition_penalty 1.05 (more focused code / fokussierterer Code)
README.md This model card / Diese Model Card
Weights, config.json, tokenizer vocab Unchanged / Unverändert

Default system prompt / Standard-Systemprompt:

You are Ocean-Coder, a coding assistant by OceanLabs. Write correct, secure, readable and efficient code. Think through edge cases before answering, explain briefly what the code does, and say clearly when you are unsure. Answer in the user's language.

Model details / Modelldetails

Property / Eigenschaft Value / Wert
Architecture / Architektur Qwen2ForCausalLM
Parameters / Parameter ~7.6B
Layers / Layer 28
Context / Kontext 32,768 tokens (up to 131,072 with YaRN rope scaling, see base model card)
Precision / Präzision bfloat16
License / Lizenz Apache 2.0

Quickstart

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "OceanLabs/Ocean-Coder-7B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Write a Python function that checks whether a string is a palindrome."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1024)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

vLLM: vllm serve OceanLabs/Ocean-Coder-7B

Intended use / Einsatzzweck

  • EN: Code generation, completion, debugging, refactoring, code review and explanation; coding assistants and agents.
  • DE: Code-Erzeugung, Vervollständigung, Debugging, Refactoring, Code-Review und Erklärungen; Coding-Assistenten und Agenten.

Limitations / Einschränkungen

  • EN: Can produce wrong or insecure code; review and test before running. No own benchmarks were run; the weights are unchanged, so the official Qwen2.5-Coder-7B-Instruct results apply. Inherits the limitations and biases of the base model.
  • DE: Kann falschen oder unsicheren Code erzeugen; vor dem Ausführen prüfen und testen. Keine eigenen Benchmarks; da die Gewichte unverändert sind, gelten die offiziellen Werte von Qwen2.5-Coder-7B-Instruct. Übernimmt Einschränkungen und Verzerrungen des Basismodells.

Credits

Base model: Qwen/Qwen2.5-Coder-7B-Instruct by the Qwen team, Alibaba Cloud.

@article{hui2024qwen2,
  title={Qwen2.5-Coder Technical Report},
  author={Hui, Binyuan and Yang, Jian and Cui, Zeyu and others},
  journal={arXiv preprint arXiv:2409.12186},
  year={2024}
}
Downloads last month
29
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OceanLabs/Ocean-Coder-7B

Base model

Qwen/Qwen2.5-7B
Finetuned
(497)
this model

Paper for OceanLabs/Ocean-Coder-7B