Spaces:
Sleeping
Sleeping
Download app/schemas.py from jonathanjordan21/Test-ticketing: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/spaces/jonathanjordan21/Test-ticketing/resolve/main/app/schemas.py
- Command line
-
hf download hf://spaces/jonathanjordan21/Test-ticketing/app/schemas.py
-
curl -L -o schemas.py https://huggingface.co/spaces/jonathanjordan21/Test-ticketing/resolve/main/app/schemas.py
1.31 kB
| from pydantic import BaseModel, Field | |
| from typing import Literal | |
| class AnalysisRequest(BaseModel): | |
| text: str = Field(min_length=1, max_length=10000) | |
| entity_labels: list[str] = Field( | |
| default=[ | |
| "person", | |
| "organization", | |
| "location", | |
| "date", | |
| "product", | |
| "money" | |
| ], | |
| max_length=25 | |
| ) | |
| entity_threshold: float = Field( | |
| default=0.5, | |
| ge=0, | |
| le=1 | |
| ) | |
| class SarcasmRequest(BaseModel): | |
| text: str = Field(min_length=1, max_length=5000) | |
| class AbsaRequest(BaseModel): | |
| text: str = Field(min_length=1, max_length=5000) | |
| aspect: str = Field(min_length=1, max_length=100) | |
| class EmbeddingRequest(BaseModel): | |
| input: list[str] = Field( | |
| min_length=1, | |
| max_length=128 | |
| ) | |
| dimensions: int | None = Field( | |
| default=None, | |
| ge=32, | |
| le=768 | |
| ) | |
| precision: Literal[ | |
| "float32", | |
| "float16", | |
| "int8" | |
| ] = "float32" | |
| normalize: bool = True | |
| class AnalysisResponse(BaseModel): | |
| entities: list[dict] | |
| sentiment: dict | |
| sarcasm: dict | |
| class EmbeddingResponse(BaseModel): | |
| dimensions: int | |
| precision: str | |
| embeddings: list[list[float] | list[int]] | |
| scales: list[float] | None = None | |