Download app/models/models.py from saskarkhadka/classification-backend: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/spaces/saskarkhadka/classification-backend/resolve/main/app/models/models.py
- Command line
-
hf download hf://spaces/saskarkhadka/classification-backend/app/models/models.py
-
curl -L -o models.py https://huggingface.co/spaces/saskarkhadka/classification-backend/resolve/main/app/models/models.py
707 Bytes
| from pydantic import BaseModel, Field | |
| from enum import Enum | |
| class MLModel(str, Enum): | |
| naivebayes = "naivebayes" | |
| gradientboost = "gradientboost" | |
| xgboost = "xgboost" | |
| class NeuralModel(str, Enum): | |
| bilstm = "bilstm" | |
| bert = "bert" | |
| mlp = "mlp" | |
| class ClassificationModel(str, Enum): | |
| bilstm = "bilstm" | |
| bert = "bert" | |
| mlp = "mlp" | |
| naivebayes = "naivebayes" | |
| gradientboost = "gradientboost" | |
| xgboost = "xgboost" | |
| class ClassificationRequest(BaseModel): | |
| text: str | |
| model: ClassificationModel = Field(default=ClassificationModel.mlp) | |
| class InferenceResult(BaseModel): | |
| prediction: str | |
| class ClassificationResponse(InferenceResult): | |
| pass |