(dedicated.audio)
- transcribe - Audio transcriptions
Given an audio file, the model transcribes it into text.
import os
from friendli import SyncFriendli
with SyncFriendli(
token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
res = friendli.dedicated.audio.transcribe(
file={
"file_name": "example.file",
"content": open("example.file", "rb"),
},
model="(endpoint-id)",
)
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
file |
models.FileModel | ✔️ | The audio file object (not file name) to transcribe, in one of these formats: mp3, wav, flac, ogg, and many other standard audio formats. | |
model |
str | ✔️ | ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone. | (endpoint-id) |
x_friendli_team |
OptionalNullable[str] | ➖ | ID of team to run requests as (optional parameter). | |
chunking_strategy |
OptionalNullable[models.ChunkingStrategy] | ➖ | Controls how the audio is cut into chunks. When set to "auto", the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. server_vad object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. |
|
language |
OptionalNullable[str] | ➖ | The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency. |
|
temperature |
OptionalNullable[float] | ➖ | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.DedicatedAudioTranscriptionSuccess
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |