codegemma

CodeGemma is a collection of powerful, lightweight models that can perform a variety of coding tasks like fill-in-the-middle code completion, code generation, natural language understanding, mathematical reasoning, and instruction following.

2b 7b
Hızlı Kurulum (Ollama kuruluysa)
ollama run codegemma

Ollama kurulu değil mi? ollama.com/download — Windows, macOS ve Linux için ücretsiz. İlk çalıştırmada model indirilir, sonrası tamamen çevrimdışıdır.

Varyantlar

Boyut büyüdükçe kalite artar, donanım ihtiyacı yükselir. Başlangıç için küçük varyantı deneyin.

EtiketBoyutBağlamGirdiKomut
latest 5.0GB 8K Text ollama run codegemma:latest
code 1.6GB 8K Text ollama run codegemma:code
instruct 5.0GB 8K Text ollama run codegemma:instruct
2b 1.6GB 8K Text ollama run codegemma:2b
7b 5.0GB 8K Text ollama run codegemma:7b
2b-code 1.6GB 8K Text ollama run codegemma:2b-code
2b-code-q2_K 1.2GB 8K Text ollama run codegemma:2b-code-q2_K
2b-code-v1.1-q2_K 1.2GB 8K Text ollama run codegemma:2b-code-v1.1-q2_K
2b-code-q3_K_S 1.3GB 8K Text ollama run codegemma:2b-code-q3_K_S
2b-code-v1.1-q3_K_S 1.3GB 8K Text ollama run codegemma:2b-code-v1.1-q3_K_S
2b-code-q3_K_M 1.4GB 8K Text ollama run codegemma:2b-code-q3_K_M
2b-code-v1.1-q3_K_M 1.4GB 8K Text ollama run codegemma:2b-code-v1.1-q3_K_M
2b-code-q3_K_L 1.5GB 8K Text ollama run codegemma:2b-code-q3_K_L
2b-code-v1.1-q3_K_L 1.5GB 8K Text ollama run codegemma:2b-code-v1.1-q3_K_L
2b-code-q4_0 1.6GB 8K Text ollama run codegemma:2b-code-q4_0
2b-code-v1.1-q4_0 1.6GB 8K Text ollama run codegemma:2b-code-v1.1-q4_0
2b-code-q4_1 1.7GB 8K Text ollama run codegemma:2b-code-q4_1
2b-code-v1.1-q4_1 1.7GB 8K Text ollama run codegemma:2b-code-v1.1-q4_1
2b-code-q4_K_S 1.6GB 8K Text ollama run codegemma:2b-code-q4_K_S
2b-code-v1.1-q4_K_S 1.6GB 8K Text ollama run codegemma:2b-code-v1.1-q4_K_S
2b-code-q4_K_M 1.6GB 8K Text ollama run codegemma:2b-code-q4_K_M
2b-code-v1.1-q4_K_M 1.6GB 8K Text ollama run codegemma:2b-code-v1.1-q4_K_M
2b-code-q5_0 1.8GB 8K Text ollama run codegemma:2b-code-q5_0
2b-code-v1.1-q5_0 1.8GB 8K Text ollama run codegemma:2b-code-v1.1-q5_0
2b-code-q5_1 1.9GB 8K Text ollama run codegemma:2b-code-q5_1

60 varyant daha var — tümü için ollama.com.

Model Detayları ve Benchmarklar (kaynak: ollama.com)

CodeGemma is a collection of powerful, lightweight models that can perform a variety of coding tasks like fill-in-the-middle code completion, code generation, natural language understanding, mathematical reasoning, and instruction following.

Variants:

  • instruct a 7b instruction-tuned variant for natural language-to-code chat and instruction following
  • code a 7b pretrained variant that specializes in code completion and generation from code prefixes and/or suffixes
  • 2b a state of the art 2B pretrained variant that provides up to 2x faster code completion

Advantages:

  • Intelligent code completion and generation: Complete lines, functions, and even generate entire blocks of code, whether you’re working locally or using Google Cloud resources.

  • Enhanced accuracy: Trained on 500 billion tokens of primarily English language data from web documents, mathematics, and code, CodeGemma models generate code that’s not only more syntactically correct but also semantically meaningful, reducing errors and debugging time.

  • Multi-language proficiency: Supports Python, JavaScript, Java, Kotlin, C++, C#, Rust, Go, and other languages.

  • Streamlined workflows: Integrate a CodeGemma model into your development environment to write less boilerplate and focus on interesting and differentiated code that matters, faster.

benchmarks

Fill-in-the-middle

CodeGemma models support fill-in-the-middle (FIM), for use in autocomplete or coding assistant tooling. Below is an example using the Ollama Python library:

response = generate(
  model='codegemma:2b-code',
  prompt=f'<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>',
  options={
    'num_predict': 128,
    'temperature': 0,
    'top_p': 0.9,
    'stop': ['<|file_separator|>'],
  },
)

References

Hugging Face

Report