AI & XML / LLM test suite / Results / Models / codegemma:latest
Model description
CodeGemma is a collection of powerful, lightweight models for various programming tasks, including fill-in-the-middle code completion, code generation, natural-language understanding, mathematical reasoning and instruction following.
Model family | codegemma |
|---|---|
Context | 8K |
Input | Text |
Size | 50 GB |
Family sizes | 2b, 7b |
Readme excerpt
CodeGemma is a collection of powerful, lightweight models for various programming tasks, including fill-in-the-middle code completion, code generation, natural-language understanding, mathematical reasoning and instruction following.
Variants:
instruct An instruction-tuned 7B variant for natural-language-to-code conversations and instruction following code A pretrained 7B variant specializing in code completion and generation from code prefixes and/or suffixes 2b A state-of-the-art pretrained 2B variant enabling code completion up to twice as fast
Benefits:
Intelligent code completion and generation: completes lines and functions and even generates entire code blocks, whether working locally or with Google Cloud resources. Improved accuracy: trained on 500 billion tokens of mostly English-language web documents, mathematics and code, CodeGemma models generate code that is both more syntactically correct and semantically meaningful, reducing errors and debugging time. Multilingual programming 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 sooner on interesting, differentiating code that adds real value.
Infilling (fill-in-the-middle)
CodeGemma models support fill-in-the-middle (FIM) for use in autocomplete or coding assistant tools. The following example uses 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
1270 Runs 1340 evaluated 36.2 % Score 11.5 % exactly correct
Help on evaluation, score and exact correctness
Score is a graded quality measure: correct = 100 %, mostly_correct = 80 %, partial = 50 %, wrong/not_answered = 0 %.
Exactly correct is stricter: only correct-labeled runs count. Mostly correct increases score but does not count as exactly correct.
Evaluated counts all runs with a substantive judgment. LLM-judge errors also count as evaluated, with score 0 %.
Test case Category