示例#1
0
    def get(self, task_id):
        stt_task = get_stt_task_by_task_id(task_id)

        if not stt_task:
            return make_response_error('Cannot find task ID', 404)

        return make_response(stt_task.to_dict())
示例#2
0
    def post(self):
        request.get_json(force=True)
        args = parser.parse_args()

        nmt_task = NMTTask(request_srt_content=args['srt'], lang=args['lang'])

        nmt_task.save()

        celery.send_task('translate.google.run', args=[str(nmt_task.pk)])

        return make_response(nmt_task.to_dict(), status=201)
示例#3
0
    def post(self):
        request.get_json(force=True)
        args = parser.parse_args()

        fa_task = FATask(wav_url=args['wav_url'],
                         request_srt_content=args['srt'],
                         segment=args['segment'])

        fa_task.save()

        celery.send_task('fa.run_fa', args=[str(fa_task.pk)])

        return make_response(fa_task.to_dict(), status=201)
示例#4
0
    def post(self):
        request.get_json(force=True)
        args = parser.parse_args()

        stt_task = STTTask(wav_url=args['wav_url'],
                           request_srt_content=args['srt'],
                           segment=args['segment'],
                           lang=args['lang'])

        stt_task.save()

        celery.send_task('stt.chromium.run_stt', args=[str(stt_task.pk)])

        return make_response(stt_task.to_dict(), status=201)
示例#5
0
    def post(self):
        """request->JSON:
        
        Create task by URL.
        """
        request.get_json(force=True)
        args = parser.parse_args()

        vad_task = VADTask(wav_url=args['wav_url'])

        vad_task.save()

        celery.send_task('vad.run_vad', args=[str(vad_task.pk)])

        return make_response(vad_task.to_dict(), status=201)