(request: dict[str, Any], _args: argparse.Namespace)
| 543 | ) |
| 544 | |
| 545 | def run(request: dict[str, Any], _args: argparse.Namespace) -> tuple[float, float]: |
| 546 | started = time.perf_counter() |
| 547 | model.transcribe( |
| 548 | audio=request["audio"], |
| 549 | context=request.get("context", ""), |
| 550 | language=request.get("language") or None, |
| 551 | return_time_stamps=False, |
| 552 | ) |
| 553 | if args.backend == "cuda": |
| 554 | torch.cuda.synchronize(args.device) |
| 555 | wall_ms = (time.perf_counter() - started) * 1000.0 |
| 556 | return wall_ms, input_audio_duration_sec(request) |
| 557 | |
| 558 | return model, run |
| 559 |
no test coverage detected