File size: 399 Bytes
dcd68c4
3229324
dcd68c4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI
import uvicorn
from sentence_transformers import SentenceTransformer

model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')

app = FastAPI()

@app.post('/tts')
async def transcribe(text: str):
    embeddings = model.encode([text], vad_filter=True)
    return embeddings[0]


if __name__ == '__main__':
    uvicorn.run('app:app', host='0.0.0.0', port=7860)