Spaces:
Runtime error
Runtime error
Download models.py from KsoftM/frameforge-v1: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/spaces/KsoftM/frameforge-v1/resolve/main/models.py
- Command line
-
hf download hf://spaces/KsoftM/frameforge-v1/models.py
-
curl -L -o models.py https://huggingface.co/spaces/KsoftM/frameforge-v1/resolve/main/models.py
1.81 kB
| from pydantic import BaseModel, HttpUrl, field_validator | |
| from typing import Any, Optional, Literal | |
| class FFmpegCommandRequest(BaseModel): | |
| input_url: str | |
| output_format: str = "mp4" | |
| ffmpeg_args: str = "" | |
| output_filename: Optional[str] = None | |
| def validate_format(cls, v: str) -> str: | |
| allowed = { | |
| "mp4", "webm", "mkv", "avi", "mov", | |
| "mp3", "aac", "flac", "wav", "ogg", | |
| "gif", "png", "jpg", "jpeg", "webp" | |
| } | |
| if v not in allowed: | |
| raise ValueError(f"Format '{v}' not allowed. Allowed: {', '.join(sorted(allowed))}") | |
| return v | |
| class FFprobeRequest(BaseModel): | |
| input_url: str | |
| class RendiFFmpegRequest(BaseModel): | |
| input_files: dict[str, str] | |
| output_files: dict[str, str] | |
| ffmpeg_command: str | |
| class ProgressInfo(BaseModel): | |
| percent: float = 0.0 | |
| speed: str = "" | |
| fps: str = "" | |
| time_elapsed: float = 0.0 | |
| bitrate: str = "" | |
| frame: int = 0 | |
| class JobResponse(BaseModel): | |
| job_id: str | |
| status: Literal["pending", "queued", "running", "done", "failed"] | |
| progress: ProgressInfo = ProgressInfo() | |
| download_url: Optional[str] = None | |
| error: Optional[str] = None | |
| age_seconds: Optional[float] = None | |
| class ResourceInfo(BaseModel): | |
| cpu_count: int | |
| cpu_percent: float | |
| ram_total_gb: float | |
| ram_used_gb: float | |
| ram_free_gb: float | |
| ram_percent: float | |
| tmp_free_gb: float | |
| active_jobs: int | |
| queued_jobs: int | |
| max_concurrent: int | |
| ffmpeg_threads: int | |
| class HealthResponse(BaseModel): | |
| status: str | |
| service: str | |
| version: str = "" | |
| ffmpeg_version: str = "" | |
| hw_accel: str = "none" | |
| max_concurrent: int = 4 | |
| ffmpeg_threads: int = 2 | |
| max_upload_gb: float = 0.5 | |