double-model / README.md
goldendevuz's picture
2025.07.08/14:21
32ff4cb
metadata
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.


πŸ“¦ How It Works

The model has one method:

def predict(number):
    return number * 2

That’s it. No training, no weights β€” just logic.


πŸ› οΈ Usage Example

from double_model import DoubleModel

model = DoubleModel()
print(model.predict(10))  # ➜ 20

If you're loading from a .pkl file:

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.


✨ 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