Instructions to use Prashanth-24/gemma-4-e4b-python-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Prashanth-24/gemma-4-e4b-python-lora with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Prashanth-24/gemma-4-e4b-python-lora") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use Prashanth-24/gemma-4-e4b-python-lora with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "Prashanth-24/gemma-4-e4b-python-lora" --prompt "Once upon a time"
Add Python-code LoRA adapter for gemma-4-e4b-4bit
Browse files
README.md
CHANGED
|
@@ -70,40 +70,48 @@ print(generate(model, tokenizer, prompt=prompt, max_tokens=200))
|
|
| 70 |
|
| 71 |
## Example output
|
| 72 |
|
| 73 |
-
Prompt: `
|
| 74 |
|
| 75 |
**Base model**
|
| 76 |
|
| 77 |
```
|
| 78 |
-
Here
|
| 79 |
|
| 80 |
-
|
| 81 |
-
The code to add two numbers is:
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
...
|
| 87 |
```
|
| 88 |
|
| 89 |
**Fine-tuned model**
|
| 90 |
|
| 91 |
```python
|
| 92 |
-
def
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
return a / b
|
| 97 |
```
|
| 98 |
|
| 99 |
-
The base model
|
| 100 |
-
|
| 101 |
-
`### Assistant:` turn to produce code instead of chatter.
|
| 102 |
|
| 103 |
## Limitations
|
| 104 |
|
| 105 |
-
This is a small run (500 iterations, rank 8).
|
| 106 |
-
behavior
|
| 107 |
-
|
| 108 |
-
for an "add two numbers" prompt. Treat outputs as a draft to review, not
|
| 109 |
-
production-ready code.
|
|
|
|
| 70 |
|
| 71 |
## Example output
|
| 72 |
|
| 73 |
+
Prompt: `Create a python program to multiply two numbers.`
|
| 74 |
|
| 75 |
**Base model**
|
| 76 |
|
| 77 |
```
|
| 78 |
+
Here's a response to your query:
|
| 79 |
|
| 80 |
+
**1. Introduction**
|
|
|
|
| 81 |
|
| 82 |
+
**2. Part I (Body)**
|
| 83 |
+
|
| 84 |
+
**Introduction**
|
| 85 |
+
The concept of unit multiplication is relevant in understanding how to multiply two numbers.
|
| 86 |
+
|
| 87 |
+
**Part II**
|
| 88 |
+
|
| 89 |
+
**Part II**
|
| 90 |
+
|
| 91 |
+
**Key Topics**
|
| 92 |
+
|
| 93 |
+
**Key Topics**
|
| 94 |
+
- **Factors to Consider**
|
| 95 |
+
- **Key Topics**
|
| 96 |
+
- **Key Topics**
|
| 97 |
...
|
| 98 |
```
|
| 99 |
|
| 100 |
**Fine-tuned model**
|
| 101 |
|
| 102 |
```python
|
| 103 |
+
def multiply_two_numbers(a, b):
|
| 104 |
+
return a * b
|
| 105 |
+
|
| 106 |
+
print(multiply_two_numbers(2, 3))
|
|
|
|
| 107 |
```
|
| 108 |
|
| 109 |
+
The base model drifts into a generic essay outline and never writes any code. The
|
| 110 |
+
fine-tuned model answers directly with a correct, runnable Python function — the LoRA
|
| 111 |
+
clearly taught the `### Assistant:` turn to produce code instead of chatter.
|
| 112 |
|
| 113 |
## Limitations
|
| 114 |
|
| 115 |
+
This is a small run (500 iterations, rank 8). It reliably improves "answer with code"
|
| 116 |
+
behavior and formatting, but it's a lightweight fine-tune — treat outputs as a draft to
|
| 117 |
+
review, not production-ready code.
|
|
|
|
|
|