File size: 477 Bytes
6b4cdc0
 
248fea5
6b4cdc0
 
 
 
 
 
 
 
 
 
 
 
 
 
248fea5
6b4cdc0
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from fastapi import FastAPI, UploadFile
from pydantic import BaseModel
from .functions import handle_url, get_health


class VideoURL(BaseModel):
    url: str
    from_lang: str = "en"
    to_lang: str = "hi"
    gender: str = "MALE"


app = FastAPI()


@app.get("/")
async def main():
    return get_health()

  
@app.post("/synthesize_video_url")
async def synthesize_video_url(video: VideoURL):
    return handle_url(video.url, video.from_lang, video.to_lang, video.gender)