added model support
Browse files
App/Transcription/TranscriptionRoutes.py
CHANGED
@@ -21,6 +21,11 @@ transcription_router = APIRouter(tags=["Transcription"])
|
|
21 |
async def download_audio(
|
22 |
url: str,
|
23 |
userId: int = 1,
|
|
|
|
|
|
|
|
|
|
|
24 |
):
|
25 |
user = await User.objects.filter(id=userId).first()
|
26 |
if user == None:
|
@@ -29,7 +34,7 @@ async def download_audio(
|
|
29 |
"format": "bestaudio/best",
|
30 |
"outtmpl": os.path.join("./", "%(title)s.%(ext)s"),
|
31 |
}
|
32 |
-
task = downloadfile.delay(url, ydl_opts)
|
33 |
transcription_enrty = await Transcriptions.objects.create(
|
34 |
task_id=task.id, user=user
|
35 |
)
|
|
|
21 |
async def download_audio(
|
22 |
url: str,
|
23 |
userId: int = 1,
|
24 |
+
model: str = Query(
|
25 |
+
"tiny",
|
26 |
+
enum=["tiny", "small", "medium", "base", "large-v2"],
|
27 |
+
description="Whisper model Sizes",
|
28 |
+
),
|
29 |
):
|
30 |
user = await User.objects.filter(id=userId).first()
|
31 |
if user == None:
|
|
|
34 |
"format": "bestaudio/best",
|
35 |
"outtmpl": os.path.join("./", "%(title)s.%(ext)s"),
|
36 |
}
|
37 |
+
task = downloadfile.delay(url, ydl_opts, model)
|
38 |
transcription_enrty = await Transcriptions.objects.create(
|
39 |
task_id=task.id, user=user
|
40 |
)
|