Spaces:
Runtime error
Runtime error
Commit Β·
d72e2b4
1
Parent(s): 44a93ef
2025.07.08/15:07
Browse files
README.md
CHANGED
|
@@ -1,21 +1,31 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
- toy-model
|
| 6 |
- beginner
|
| 7 |
- number
|
| 8 |
- demo
|
| 9 |
- simple
|
| 10 |
-
model_type:
|
| 11 |
-
pipeline_tag:
|
| 12 |
---
|
| 13 |
|
| 14 |
# π§ Double Model
|
| 15 |
|
| 16 |
A tiny demonstration model that simply **doubles any number** you give it.
|
| 17 |
|
| 18 |
-
This is **not a machine learning model**, but a toy example to show how to upload custom models to Hugging Face Hub.
|
|
|
|
|
|
|
| 19 |
|
| 20 |
## π¦ How It Works
|
| 21 |
|
|
@@ -26,6 +36,8 @@ def predict(number):
|
|
| 26 |
return number * 2
|
| 27 |
```
|
| 28 |
|
|
|
|
|
|
|
| 29 |
## π οΈ Usage Example
|
| 30 |
|
| 31 |
```python
|
|
@@ -34,16 +46,33 @@ model = DoubleModel()
|
|
| 34 |
print(model.predict(10)) # β 20
|
| 35 |
```
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## π Files Included
|
| 38 |
|
| 39 |
- `double_model.py` β the model class
|
| 40 |
- `double_model.pkl` β the pickled version of the model
|
| 41 |
-
- `
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
## π License
|
| 44 |
|
| 45 |
MIT License
|
| 46 |
|
|
|
|
|
|
|
| 47 |
## π€ Author
|
| 48 |
|
| 49 |
[goldendevuz](https://huggingface.co/goldendevuz)
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Double Model Demo
|
| 3 |
+
emoji: π§
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.16.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
language: en
|
| 12 |
tags:
|
| 13 |
- toy-model
|
| 14 |
- beginner
|
| 15 |
- number
|
| 16 |
- demo
|
| 17 |
- simple
|
| 18 |
+
model_type: custom
|
| 19 |
+
pipeline_tag: other
|
| 20 |
---
|
| 21 |
|
| 22 |
# π§ Double Model
|
| 23 |
|
| 24 |
A tiny demonstration model that simply **doubles any number** you give it.
|
| 25 |
|
| 26 |
+
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/).
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
|
| 30 |
## π¦ How It Works
|
| 31 |
|
|
|
|
| 36 |
return number * 2
|
| 37 |
```
|
| 38 |
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
## π οΈ Usage Example
|
| 42 |
|
| 43 |
```python
|
|
|
|
| 46 |
print(model.predict(10)) # β 20
|
| 47 |
```
|
| 48 |
|
| 49 |
+
If loading from `.pkl`:
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
import pickle
|
| 53 |
+
with open("double_model.pkl", "rb") as f:
|
| 54 |
+
model = pickle.load(f)
|
| 55 |
+
print(model.predict(7)) # β 14
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
## π Files Included
|
| 61 |
|
| 62 |
- `double_model.py` β the model class
|
| 63 |
- `double_model.pkl` β the pickled version of the model
|
| 64 |
+
- `app.py` β Gradio web demo
|
| 65 |
+
- `README.md` β model card
|
| 66 |
+
- `requirements.txt` β Space dependencies
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
|
| 70 |
## π License
|
| 71 |
|
| 72 |
MIT License
|
| 73 |
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
## π€ Author
|
| 77 |
|
| 78 |
[goldendevuz](https://huggingface.co/goldendevuz)
|