Finally fixed
continuous-integration/drone Build is passing
Details
continuous-integration/drone Build is passing
Details
This commit is contained in:
parent
dd2a3cfff5
commit
6c259c1451
|
@ -1,4 +1,4 @@
|
||||||
FROM python:3.9
|
FROM registry.kmlabz.com/birbnetes/ai-base-image
|
||||||
|
|
||||||
ADD svm_prefilter_service requirements.txt uwsgi.ini /svm_prefilter_service/
|
ADD svm_prefilter_service requirements.txt uwsgi.ini /svm_prefilter_service/
|
||||||
WORKDIR /svm_prefilter_service/
|
WORKDIR /svm_prefilter_service/
|
||||||
|
|
|
@ -17,22 +17,24 @@ cython
|
||||||
six
|
six
|
||||||
deprecation
|
deprecation
|
||||||
|
|
||||||
cycler~=0.10.0
|
cycler==0.10.0
|
||||||
|
deprecation==2.0.7
|
||||||
eyeD3==0.9.5
|
eyeD3==0.9.5
|
||||||
filetype==1.0.6
|
filetype==1.0.6
|
||||||
hmmlearn==0.2.3
|
hmmlearn==0.2.3
|
||||||
joblib~=1.0.1
|
joblib==0.14.1
|
||||||
kiwisolver~=1.2.0
|
kiwisolver==1.2.0
|
||||||
matplotlib~=3.3.3
|
matplotlib==3.2.1
|
||||||
numpy~=1.20.3
|
numpy==1.18.2
|
||||||
pydub==0.23.1
|
pydub==0.23.1
|
||||||
pyparsing==2.4.6
|
pyparsing==2.4.6
|
||||||
python-dateutil==2.8.1
|
python-dateutil==2.8.1
|
||||||
scikit-learn~=0.24.0
|
scikit-learn==0.21.3
|
||||||
scipy~=1.6.2
|
scipy==1.4.1
|
||||||
simplejson~=3.17.2
|
simplejson==3.17.0
|
||||||
|
six==1.14.0
|
||||||
plotly
|
plotly
|
||||||
|
|
||||||
pyAudioAnalysis~=0.3.0
|
pyAudioAnalysis~=0.3.0
|
||||||
tqdm~=4.61.1
|
tqdm==4.61.1
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,13 @@ if Config.SENTRY_DSN:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def json_datetime_dumper(o):
|
||||||
|
if hasattr(o, "isoformat"):
|
||||||
|
return o.isoformat()
|
||||||
|
else:
|
||||||
|
return str(o)
|
||||||
|
|
||||||
|
|
||||||
class ModelMemer:
|
class ModelMemer:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -41,13 +48,13 @@ class ModelMemer:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
self.model_details = r.json()
|
self.model_details = r.json()
|
||||||
|
|
||||||
r = requests.get(urljoin(Config.MODEL_INFO_URL,self.model_details['files']['model']))
|
r = requests.get(urljoin(Config.MODEL_INFO_URL, self.model_details['files']['model']))
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
with open(model_file, 'wb') as f:
|
with open(model_file, 'wb') as f:
|
||||||
f.write(r.content)
|
f.write(r.content)
|
||||||
|
|
||||||
r = requests.get(urljoin(Config.MODEL_INFO_URL,self.model_details['files']['means']))
|
r = requests.get(urljoin(Config.MODEL_INFO_URL, self.model_details['files']['means']))
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
with open(means_file, 'wb') as f:
|
with open(means_file, 'wb') as f:
|
||||||
|
@ -123,7 +130,7 @@ def main():
|
||||||
'audio/wave',
|
'audio/wave',
|
||||||
{'Content-length': os.path.getsize(audio_file_path)}
|
{'Content-length': os.path.getsize(audio_file_path)}
|
||||||
),
|
),
|
||||||
"description": (None, json.dumps(description), "application/json")
|
"description": (None, json.dumps(description, default=json_datetime_dumper), "application/json")
|
||||||
}
|
}
|
||||||
|
|
||||||
r = requests.post(Config.INPUT_SERVICE_URL, files=files)
|
r = requests.post(Config.INPUT_SERVICE_URL, files=files)
|
||||||
|
|
|
@ -36,8 +36,9 @@ class FilterView(FlaskView):
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
return abort(417, 'Input JSON schema invalid')
|
return abort(417, 'Input JSON schema invalid')
|
||||||
|
|
||||||
soundfile_handle, soundfile_path = tempfile.mkstemp()
|
soundfile_handle, soundfile_path = tempfile.mkstemp(suffix=".wav")
|
||||||
soundfile.save(open(soundfile_handle, "wb+"))
|
with open(soundfile_handle, "wb+") as f:
|
||||||
|
soundfile.save(f)
|
||||||
|
|
||||||
task = {
|
task = {
|
||||||
"audio_file_path": soundfile_path,
|
"audio_file_path": soundfile_path,
|
||||||
|
|
Loading…
Reference in New Issue