Commit
Β·
32ff4cb
1
Parent(s):
1cd9af2
2025.07.08/14:21
Browse files
README.md
CHANGED
@@ -1,11 +1,82 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
```python
|
8 |
from double_model import DoubleModel
|
|
|
9 |
model = DoubleModel()
|
10 |
-
print(model.predict(
|
11 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: "en"
|
3 |
+
license: "mit"
|
4 |
+
tags:
|
5 |
+
- toy-model
|
6 |
+
- beginner
|
7 |
+
- number
|
8 |
+
- demo
|
9 |
+
- simple
|
10 |
+
model_type: "custom"
|
11 |
+
pipeline_tag: "other"
|
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](https://huggingface.co/).
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
## π¦ How It Works
|
23 |
+
|
24 |
+
The model has one method:
|
25 |
+
|
26 |
+
```python
|
27 |
+
def predict(number):
|
28 |
+
return number * 2
|
29 |
+
```
|
30 |
+
|
31 |
+
Thatβs it. No training, no weights β just logic.
|
32 |
+
|
33 |
+
---
|
34 |
+
|
35 |
+
## π οΈ Usage Example
|
36 |
|
37 |
```python
|
38 |
from double_model import DoubleModel
|
39 |
+
|
40 |
model = DoubleModel()
|
41 |
+
print(model.predict(10)) # β 20
|
42 |
```
|
43 |
+
|
44 |
+
If you're loading from a `.pkl` file:
|
45 |
+
|
46 |
+
```python
|
47 |
+
import pickle
|
48 |
+
|
49 |
+
with open("double_model.pkl", "rb") as f:
|
50 |
+
model = pickle.load(f)
|
51 |
+
|
52 |
+
print(model.predict(7)) # β 14
|
53 |
+
```
|
54 |
+
|
55 |
+
---
|
56 |
+
|
57 |
+
## π Files Included
|
58 |
+
|
59 |
+
- `double_model.py` β the model class
|
60 |
+
- `double_model.pkl` β the pickled version of the model
|
61 |
+
- `README.md` β model card
|
62 |
+
|
63 |
+
---
|
64 |
+
|
65 |
+
## π License
|
66 |
+
|
67 |
+
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
68 |
+
|
69 |
+
---
|
70 |
+
|
71 |
+
## β¨ Why This Exists
|
72 |
+
|
73 |
+
To demonstrate:
|
74 |
+
- How to create simple Python-based models
|
75 |
+
- How to package and upload to Hugging Face Hub
|
76 |
+
- How even non-ML logic can be versioned and shared like models
|
77 |
+
|
78 |
+
---
|
79 |
+
|
80 |
+
## π€ Author
|
81 |
+
|
82 |
+
[goldendevuz](https://huggingface.co/goldendevuz)
|