Download models.py from hf1024/grok-api: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/spaces/hf1024/grok-api/resolve/main/models.py
- Command line
-
hf download hf://spaces/hf1024/grok-api/models.py
-
curl -L -o models.py https://huggingface.co/spaces/hf1024/grok-api/resolve/main/models.py
675 Bytes
| # !/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| @Author : Ailove | |
| ------------------------------------ | |
| @File : models.py | |
| @CreateTime : 2025/5/22 20:36 | |
| ------------------------------------ | |
| """ | |
| from pydantic import BaseModel, Field | |
| class ImageRequest(BaseModel): | |
| url: str = None | |
| class ImageCompareRequest(BaseModel): | |
| img_1: str = None | |
| url_1: str = None | |
| img_2: str = None | |
| url_2: str = None | |
| class QuestionRequest(BaseModel): | |
| text: str = Field(..., description="用户提出的问题") | |
| end_flag: bool = True | |
| streaming: bool = False | |
| model: str = Field(..., description="要使用的模型ID") | |