Spaces:
Running
Running
Yurii Paniv
commited on
Commit
•
fce8789
1
Parent(s):
bca4ff8
Dockerize application
Browse files- .dockerignore +7 -0
- Dockerfile +6 -0
- app.ini +8 -0
- main.py +4 -0
- requirements.txt +2 -1
.dockerignore
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__/
|
2 |
+
.venv/
|
3 |
+
.env
|
4 |
+
.git
|
5 |
+
LICENSE
|
6 |
+
README.md
|
7 |
+
*.tflite
|
Dockerfile
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.7
|
2 |
+
COPY . /app
|
3 |
+
WORKDIR /app
|
4 |
+
RUN wget https://github.com/robinhad/voice-recognition-ua/releases/download/0.1/uk.tflite
|
5 |
+
RUN pip install -r requirements.txt
|
6 |
+
CMD ["uwsgi", "app.ini"]
|
app.ini
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[uwsgi]
|
2 |
+
wsgi-file = main.py
|
3 |
+
callable = app
|
4 |
+
http = :5000
|
5 |
+
processes = 2
|
6 |
+
master = true
|
7 |
+
vacuum = true
|
8 |
+
die-on-term = true
|
main.py
CHANGED
@@ -18,3 +18,7 @@ def recognize():
|
|
18 |
audio.seek(0)
|
19 |
result = client(audio)
|
20 |
return result
|
|
|
|
|
|
|
|
|
|
18 |
audio.seek(0)
|
19 |
result = client(audio)
|
20 |
return result
|
21 |
+
|
22 |
+
|
23 |
+
if __name__ == '__main__':
|
24 |
+
app.run(host='0.0.0.0')
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
Flask==1.1.2
|
2 |
deepspeech-tflite==0.7.3
|
3 |
-
numpy==1.17.0
|
|
|
|
1 |
Flask==1.1.2
|
2 |
deepspeech-tflite==0.7.3
|
3 |
+
numpy==1.17.0
|
4 |
+
uwsgi==2.0.19.1
|