double-model-demo / README.md
goldendevuz's picture
2025.07.08/15:07
d72e2b4

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
title: Double Model Demo
emoji: 🧠
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 4.16.0
app_file: app.py
pinned: false
license: mit
language: en
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

πŸ› οΈ Usage Example

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

If loading from .pkl:

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
  • app.py β€” Gradio web demo
  • README.md β€” model card
  • requirements.txt β€” Space dependencies

πŸ“„ License

MIT License


πŸ€– Author

goldendevuz