Spaces:
Configuration error
Configuration error
Download axis_numeric/api_models.py from serety95/axis-numeric: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/serety95/axis-numeric/resolve/main/axis_numeric/api_models.py
- Command line
-
hf download hf://spaces/serety95/axis-numeric/axis_numeric/api_models.py
-
curl -L -o api_models.py https://huggingface.co/spaces/serety95/axis-numeric/resolve/main/axis_numeric/api_models.py
1.04 kB
| """Pydantic transport models mirroring numeric-inference.v1.schema.json.""" | |
| from typing import Literal | |
| from pydantic import BaseModel, ConfigDict, Field, field_validator | |
| from .contracts import SemanticClass | |
| class NumericRequest(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| contractVersion: Literal[1] | |
| requestId: str = Field(min_length=1, max_length=128) | |
| zoneId: str = Field(min_length=1, max_length=128) | |
| imageBase64: str = Field(min_length=1, max_length=8_388_608) | |
| mimeType: Literal["image/png", "image/jpeg", "image/webp"] | |
| semanticClass: SemanticClass | |
| expectedLength: int | None = Field(default=None, ge=1, le=64) | |
| locale: Literal["ar-EG", "en-EG"] | None = None | |
| def validate_base64_shape(cls, value: str) -> str: | |
| if any(char not in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" for char in value): | |
| raise ValueError("invalid_image_payload") | |
| return value | |