aryo100 commited on
Commit
5dff780
·
1 Parent(s): 7643dab

update api

Browse files
Files changed (1) hide show
  1. api.py +3 -4
api.py CHANGED
@@ -7,14 +7,13 @@ import fairseq
7
  from fastapi import FastAPI, HTTPException
8
  from fastapi.responses import FileResponse
9
  from pydantic import BaseModel
10
- from infer.modules.vc.modules import VC
11
- from configs.config import Config
12
  from uuid import uuid4
13
  import requests
14
 
15
  app = FastAPI()
16
 
17
- models = [
18
  {
19
  "name": "zeta",
20
  "label": "Zeta",
@@ -76,7 +75,7 @@ def limit_tts_files(output_dir, max_files=10):
76
  @app.post("/tts")
77
  async def tts_api(req: TTSRequest):
78
  # Cari model berdasarkan name
79
- model = next((m for m in models if m["name"] == req.name), None)
80
  if not model:
81
  raise HTTPException(status_code=404, detail=f"Model '{req.name}' not found.")
82
 
 
7
  from fastapi import FastAPI, HTTPException
8
  from fastapi.responses import FileResponse
9
  from pydantic import BaseModel
10
+ from modules import models
 
11
  from uuid import uuid4
12
  import requests
13
 
14
  app = FastAPI()
15
 
16
+ path_models = [
17
  {
18
  "name": "zeta",
19
  "label": "Zeta",
 
75
  @app.post("/tts")
76
  async def tts_api(req: TTSRequest):
77
  # Cari model berdasarkan name
78
+ model = next((m for m in path_models if m["name"] == req.name), None)
79
  if not model:
80
  raise HTTPException(status_code=404, detail=f"Model '{req.name}' not found.")
81