Spaces:
Sleeping
Sleeping
Download app/models/request_models.py from Faysal1000/embedding-server: direct link, hf CLI and curl.
- Browser
- Download file 603 Bytes
-
https://huggingface.co/spaces/Faysal1000/embedding-server/resolve/main/app/models/request_models.py
- Command line
-
hf download hf://spaces/Faysal1000/embedding-server/app/models/request_models.py
-
curl -L -o request_models.py https://huggingface.co/spaces/Faysal1000/embedding-server/resolve/main/app/models/request_models.py
603 Bytes
| # app/models/request_models.py | |
| """ | |
| Pydantic request models for the API endpoints. | |
| """ | |
| from typing import List | |
| from pydantic import BaseModel, Field | |
| class SingleRequest(BaseModel): | |
| text: str = Field( | |
| ..., | |
| description="The text content to be embedded.", | |
| min_length=1, | |
| examples=["Hello, this is a test sentence."] | |
| ) | |
| class BatchRequest(BaseModel): | |
| texts: List[str] = Field( | |
| ..., | |
| description="List of text strings to embed.", | |
| min_items=1, | |
| examples=[["Hello world", "This is another sentence"]] | |
| ) | |