Upload 8 files
Browse files- .gitignore +3 -0
- LICENSE +14 -0
- README.md +32 -3
- config.json +7 -0
- inference.py +7 -0
- model.py +6 -0
- requirements.txt +1 -0
- sample_input.json +3 -0
.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
.ipynb_checkpoints/
|
| 3 |
+
*.pyc
|
LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2025
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 13 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 14 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- dummy
|
| 6 |
+
- example
|
| 7 |
+
- coursework
|
| 8 |
+
license: mit
|
| 9 |
+
pipeline_tag: text-classification
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# DummyModel ✨
|
| 13 |
+
|
| 14 |
+
A **dummy** model repo published for a class assignment.
|
| 15 |
+
It does not perform real ML; it echoes inputs and marks everything as `LABEL_0`.
|
| 16 |
+
|
| 17 |
+
## How to use
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from inference import predict
|
| 21 |
+
predict("hello world")
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
- `inference.py`: toy `predict()` function
|
| 26 |
+
- `model.py`: placeholder `DummyModel` class
|
| 27 |
+
- `config.json`: minimal metadata
|
| 28 |
+
- `requirements.txt`: tiny deps (none actually required for the echo demo)
|
| 29 |
+
- `sample_input.json`: quick test payload
|
| 30 |
+
|
| 31 |
+
## Disclaimer
|
| 32 |
+
This is a non-functional demo used to learn the Hugging Face publishing workflow.
|
config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DummyModel"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "dummy",
|
| 6 |
+
"created": "2025-09-21T21:45:01.006328Z"
|
| 7 |
+
}
|
inference.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from model import DummyModel
|
| 2 |
+
|
| 3 |
+
_model = DummyModel()
|
| 4 |
+
|
| 5 |
+
def predict(text: str):
|
| 6 |
+
"""Return a canned label for any input text."""
|
| 7 |
+
return _model(text)
|
model.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class DummyModel:
|
| 2 |
+
def __init__(self, label="LABEL_0"):
|
| 3 |
+
self.label = label
|
| 4 |
+
|
| 5 |
+
def __call__(self, text: str):
|
| 6 |
+
return {"label": self.label, "score": 1.0, "input": text}
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# No external dependencies required for the dummy example
|
sample_input.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"text": "this is a test"
|
| 3 |
+
}
|