Model Card for Model ID

Model Details

Model Description

This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • Developed by: Jaehun Lee, Gunha Hong
  • Model type: Fine-tuned Gemma2-2b-it variant
  • Language(s) (NLP): Primarily English, used in coding tasks
  • Finetuned from model: Gemma2-2b-it

Uses

Direct Use

Gemma-2-2b-it is fine-tuned for the following direct uses:

Code Generation: Automatically generating code from natural language instructions. Code Evaluation: Evaluating the logic and correctness of code snippets. Debugging: Identifying bugs and suggesting fixes in code. Optimization: Proposing improvements to enhance code performance.

Out-of-Scope Use

This model is not intended for general NLP tasks outside the coding domain or tasks requiring extensive world knowledge beyond programming.

Bias, Risks, and Limitations

As this model has been fine-tuned specifically for coding, it may underperform in non-programming contexts. The model could generate erroneous code, or incorrect solutions, especially in edge cases or languages less represented in the dataset. It might also produce biased or outdated recommendations for coding practices.

Recommendations

Users should be aware of the model’s limitations, especially when using it in production environments. Manual review of the generated code is strongly recommended to avoid potential errors. Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

How to Get Started with the Model

Use the code below to get started with the model.

# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Molohazi/gemma-2-2b-it-coding")
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Molohazi/gemma-2-2b-it-coding")
model = AutoModelForCausalLM.from_pretrained("Molohazi/gemma-2-2b-it-coding")

Training Details

Training Data

Gemma-2-2b-it was fine-tuned using the llama-duo/gemma2b-coding-eval-by-claude3sonnet dataset, which contains a variety of coding tasks, code evaluations, and solutions. This dataset includes examples from a range of programming languages and coding styles.

Training Procedure

Preprocessing The data was preprocessed to standardize the format of code snippets and ensure compatibility with the model architecture.

Training Hyperparameters

  • Learning rate: 2e-4
  • Optimizer: AdamW
  • Max_steps: 300
  • Max_seq_length: 512

Test the Model

Python Coding Questions

User input:

"How do I write a function in Python?"

Model output

In Python, a function is defined using the `def` keyword followed by the function name, parentheses, and a colon. Inside the function, you can write code that gets executed when the function is called. Here's a simple example:

def greet(name):
    return f"Hello, {name}!"

# Example usage:
print(greet("Alice"))  # Output: Hello, Alice!
Downloads last month
155
Safetensors
Model size
2.61B params
Tensor type
FP16
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.