pandora_transcribe/management/commands/transcribe.py

29 lines
1.3 KiB
Python
Raw Normal View History

2024-07-07 14:32:37 +00:00
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db import transaction
import app.monkey_patch
from ... import transcribe
class Command(BaseCommand):
help = 'transcribe items with whisper_timestamped'
def add_arguments(self, parser):
parser.add_argument('--user', type=str, dest='user',
default='subtitles', help='user for subtitles (default: subtitles)')
parser.add_argument('--queue', type=str, dest='queue',
default='Queue', help='name of incoming list (default: Queue)')
parser.add_argument('--done', type=str, dest='done',
default='Transcribed', help='name of incoming list (default: Transcribed)')
parser.add_argument('--layer', type=str, dest='layer',
default=None, help='import into layer (default subtitle layer)')
parser.add_argument('--translate', type=str, dest='translate',
default='', help='list of languages to translate: (i.e. hi:en,de:en')
parser.add_argument('--gpu', action='store_true', dest='gpu',
default=False, help='user GPU (default: disabled)')
def handle(self, **kwargs):
transcribe.main(**kwargs)