Daryl Fung commited on
Commit
dcd68c4
1 Parent(s): 0a0fda1

added requirements

Browse files
Files changed (2) hide show
  1. app.py +15 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from sentence_transformers import SentenceTransformer
3
+
4
+ model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
5
+
6
+ app = FastAPI()
7
+
8
+ @app.post('/tts')
9
+ async def transcribe(text: str):
10
+ embeddings = model.encode([text], vad_filter=True)
11
+ return embeddings[0]
12
+
13
+
14
+ if __name__ == '__main__':
15
+ uvicorn.run('app:app', host='0.0.0.0', port=7860)
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ sentence_transformers==2.2.2
2
+ fastapi==0.104.1
3
+ uvicorn==0.24.0.post1
4
+ python-multipart==0.0.6