Model Description
Stentor Python 30M is a compact language model specifically fine-tuned for Python code generation and autocompletion tasks. Based on the Stentor-30M architecture, this model contains 30 million parameters and is designed to run efficiently on resource-constrained devices including mobile phones and embedded systems.
Model Details
Training Data
The model was fine-tuned on a curated dataset of 872 Python examples, including:
All examples follow a consistent format with "### Task:" instruction and "### Solution:" code block.
Training Process
The fine-tuning process involved multiple stages:
Evaluation Results
The model was evaluated on several test categories:
| Category | Pass Rate | Notes |
|---|---|---|
| Basic functions | 80% | Factorial, prime check, etc. |
| Classes from training set | 100% | Stack, BankAccount, Rectangle |
| New complex classes | 33% | Graph, Queue, inheritance |
| Function signatures (MBPP) | 100% | Correctly generates def statements |
Capabilities
Limitations
Recommended Use Cases
Not Recommended For
Usage Example
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = "stas122/stentor_python_30m"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)
prompt = "### Task: Write a function that checks if a number is even\n\n### Solution:\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, temperature=0.2)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
Ethical Considerations
This model is intended for educational and development assistance purposes. Users should verify all generated code before deployment, particularly for security-sensitive applications. The model may occasionally produce incorrect or inefficient code and should not be relied upon as the sole source of truth for programming tasks.
Contact
For questions or feedback about this model, please open an issue on the Hugging Face repository.
StentorLabs/Stentor-30M