|
|
--- |
|
|
language: "en" |
|
|
license: "mit" |
|
|
tags: |
|
|
- toy-model |
|
|
- beginner |
|
|
- number |
|
|
- demo |
|
|
- simple |
|
|
model_type: "custom" |
|
|
pipeline_tag: "other" |
|
|
--- |
|
|
|
|
|
# π§ Double Model |
|
|
|
|
|
A tiny demonstration model that simply **doubles any number** you give it. |
|
|
|
|
|
This is **not a machine learning model**, but a toy example to show how to upload custom models to [Hugging Face Hub](https://huggingface.co/). |
|
|
|
|
|
--- |
|
|
|
|
|
## π¦ How It Works |
|
|
|
|
|
The model has one method: |
|
|
|
|
|
```python |
|
|
def predict(number): |
|
|
return number * 2 |
|
|
``` |
|
|
|
|
|
Thatβs it. No training, no weights β just logic. |
|
|
|
|
|
--- |
|
|
|
|
|
## π οΈ Usage Example |
|
|
|
|
|
```python |
|
|
from double_model import DoubleModel |
|
|
|
|
|
model = DoubleModel() |
|
|
print(model.predict(10)) # β 20 |
|
|
``` |
|
|
|
|
|
If you're loading from a `.pkl` file: |
|
|
|
|
|
```python |
|
|
import pickle |
|
|
|
|
|
with open("double_model.pkl", "rb") as f: |
|
|
model = pickle.load(f) |
|
|
|
|
|
print(model.predict(7)) # β 14 |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π Files Included |
|
|
|
|
|
- `double_model.py` β the model class |
|
|
- `double_model.pkl` β the pickled version of the model |
|
|
- `README.md` β model card |
|
|
|
|
|
--- |
|
|
|
|
|
## π License |
|
|
|
|
|
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT). |
|
|
|
|
|
--- |
|
|
|
|
|
## β¨ Why This Exists |
|
|
|
|
|
To demonstrate: |
|
|
- How to create simple Python-based models |
|
|
- How to package and upload to Hugging Face Hub |
|
|
- How even non-ML logic can be versioned and shared like models |
|
|
|
|
|
--- |
|
|
|
|
|
## π€ Author |
|
|
|
|
|
[goldendevuz](https://huggingface.co/goldendevuz) |
|
|
|