Spaces:
No application file
No application file
| export const VALID_MODELS = { | |
| ACE_STEP: "ACE-Step/ACE-Step-v1-3.5B", | |
| DREAM_VAE: "daydreamlive/DreamVAE", | |
| }; | |
| export function validateModel(model: string) { | |
| return Object.values(VALID_MODELS).includes(model); | |
| } | |
| export function validateApiKey(key?: string) { | |
| return typeof key === "string" && key.trim().length > 0; | |
| } | |
| // lib/types.ts | |
| export type VoiceType = "Random" | "Male" | "Female"; | |
| export interface GenerateRequestBody { | |
| stylePrompt: string; | |
| lyricPrompt?: string; | |
| voice: VoiceType; | |
| durationSeconds?: number; | |
| } | |
| export interface EditRequestBody { | |
| operation: "cover" | "extend" | "swap_vocal" | "crop"; | |
| trackId: string; | |
| params?: Record<string, unknown>; | |
| } | |
| // lib/cache.ts | |
| const genCache = new Map<string, any>(); | |
| export function getCachedGeneration(key: string) { | |
| return genCache.get(key); | |
| } | |
| export function setCachedGeneration(key: string, value: any) { | |
| genCache.set(key, value); | |
| } | |