fixed worker
Browse files- App/Worker.py +4 -4
App/Worker.py
CHANGED
@@ -20,12 +20,12 @@ def generate_store(self, data, task_id):
|
|
20 |
|
21 |
@celery.task(name="transcription", bind=True)
|
22 |
def transcription_task(self, file_path, model_size="tiny"):
|
23 |
-
|
24 |
-
|
25 |
-
encode(chunks)
|
26 |
return data
|
27 |
|
28 |
|
|
|
29 |
@celery.task(name="download", bind=True)
|
30 |
def downloadfile(self, url, ydl_opts, model_size="base"):
|
31 |
# updated
|
@@ -38,7 +38,7 @@ def downloadfile(self, url, ydl_opts, model_size="base"):
|
|
38 |
# updated
|
39 |
self.update_state(state="Downloading complete", meta={})
|
40 |
audio_file = ydl_opts["outtmpl"]
|
41 |
-
print(model_size,
|
42 |
# print(audio_file["default"])
|
43 |
data = transcribe_file(
|
44 |
state=self, file_path=audio_file["default"], model_size=model_size
|
|
|
20 |
|
21 |
@celery.task(name="transcription", bind=True)
|
22 |
def transcription_task(self, file_path, model_size="tiny"):
|
23 |
+
data = transcribe_file(state=self, file_path=file_path, model_size=model_size)
|
24 |
+
generate_store.delay(data["content"], self.request.id)
|
|
|
25 |
return data
|
26 |
|
27 |
|
28 |
+
|
29 |
@celery.task(name="download", bind=True)
|
30 |
def downloadfile(self, url, ydl_opts, model_size="base"):
|
31 |
# updated
|
|
|
38 |
# updated
|
39 |
self.update_state(state="Downloading complete", meta={})
|
40 |
audio_file = ydl_opts["outtmpl"]
|
41 |
+
print(model_size, "worker after")
|
42 |
# print(audio_file["default"])
|
43 |
data = transcribe_file(
|
44 |
state=self, file_path=audio_file["default"], model_size=model_size
|