44#
55
66from collections .abc import Callable
7+ from typing import BinaryIO
78
89from ...services import PredictorService , PredictionService
9- from ...types import Acceleration , Dtype
10+ from ...types import Acceleration
1011from ..remote import RemoteAcceleration
1112from ..remote .remote import RemotePredictionService
13+ from .schema import Transcription
1214
1315TranscriptionDelegate = Callable [..., object ]
1416
@@ -26,4 +28,32 @@ def __init__(
2628 self .__predictors = predictors
2729 self .__predictions = predictions
2830 self .__remote_predictions = remote_predictions
29- self .__cache = dict [str , TranscriptionDelegate ]()
31+ self .__cache = dict [str , TranscriptionDelegate ]()
32+
33+ def create (
34+ self ,
35+ * ,
36+ file : BinaryIO ,
37+ model : str ,
38+ language : str | None = None ,
39+ prompt : str | None = None ,
40+ stream : bool = False ,
41+ temperature : float = 0. ,
42+ acceleration : Acceleration | RemoteAcceleration = "remote_auto"
43+ ) -> Transcription :
44+ """
45+ Transcribe audio into the input language.
46+
47+ Parameters:
48+ file (BinaryIO): Audio file to transcribe. MUST be flac, mp3, ogg, wav.
49+ model (str): Transcription model tag.
50+ language (str): The language of the input audio.
51+ prompt (str): Text to guide the model's style or continue a previous audio segment.
52+ stream (bool): Whether to stream transcription events.
53+ temperature (float): The sampling temperature, between 0 and 1.
54+ acceleration (Acceleration | RemoteAcceleration): Prediction acceleration.
55+
56+ Returns:
57+ Transcription: Result transcription.
58+ """
59+ pass
0 commit comments