---
viewer: false
tags:
- uv-script
- hf-jobs
- audio
- transcription
- automatic-speech-recognition
- speaker-diarization
- multilingual
---
# Transcription UV Scripts
> Part of [uv-scripts](https://huggingface.co/uv-scripts): self-contained UV scripts you run on Hugging Face Jobs in one command.
Scripts that transcribe audio files on a GPU with [Hugging Face Jobs](https://huggingface.co/docs/hub/jobs). Audio comes in from a [Bucket](https://huggingface.co/docs/hub/storage-buckets) or a local folder; transcripts go out as `.txt`, JSON (speaker segments or word timestamps), `.srt` or parquet.
## Quick Start
First, [install the `hf` CLI and sign in](https://huggingface.co/docs/hub/jobs-quickstart). Jobs needs pay-as-you-go credit. Use `hf` 1.32 or newer (`hf version`): older CLIs ignore the script's launch header without a warning, and the Job then runs on a CPU.
Transcribe four minutes of NASA's *Houston We Have a Podcast* (a host and a guest, from the [demo Bucket](https://huggingface.co/buckets/uv-scripts/transcription-demo)) with [Nemotron 3.5 Transcribe](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B). Replace `your-username` with your Hugging Face username:
```bash
hf buckets create your-username/transcripts --private
hf jobs uv run --timeout 45m \
-v hf://buckets/uv-scripts/transcription-demo/podcast:/input:ro \
-v hf://buckets/your-username/transcripts/podcast:/output \
https://huggingface.co/datasets/uv-scripts/transcription/raw/main/nemotron-transcribe.py \
/input /output --timestamps
```
The Job writes a `.txt` with speaker tags and a `.json` with word timestamps to your Bucket:
```
Jim, thank you so much for coming on the podcast today. ... It is, uh, the mission control room, of course, is now open for business ...
```
Our test run took about 7.5 minutes on `rtx-pro-6000` (about $0.34), almost all of it model setup. Read the result with `hf buckets cp hf://buckets/your-username/transcripts/podcast/nasa-podcast-ep100.txt -`.
More on this example: JSON output, MOSS on the same clip, harder audio, launch headers
**JSON output.** Every word has a start and end time and a speaker (`parts[].alignment.words`), plus diarization segments (`parts[].alignment.diarization`):
```json
{"word": "sustainable", "start": 0.02, "end": 0.98, "speaker": "0", "part": 0}
```
**MOSS on the same clip.** [MOSS-Transcribe-Diarize](https://huggingface.co/OpenMOSS-Team/MOSS-Transcribe-Diarize) on the same clip took under 2 minutes on `l4x1` (about $0.02) and wrote one line per segment (`[61.82 - 67.06] S02: The mission control room, ...`):
```bash
hf jobs uv run --flavor l4x1 -s HF_TOKEN --timeout 30m \
-e UV_TORCH_BACKEND=cu128 \
-v hf://buckets/uv-scripts/transcription-demo/podcast:/input:ro \
-v hf://buckets/your-username/transcripts/podcast-moss:/output \
https://huggingface.co/datasets/uv-scripts/transcription/raw/main/moss-transcribe-diarize.py \
/input /output --emit-txt
```
**Harder audio.** Mount `/apollo11` instead of `/podcast`: two clips of 1969 mission tapes with radio noise and crosstalk. The [demo Bucket's README](https://huggingface.co/buckets/uv-scripts/transcription-demo) gives the sources and licences (NASA, public domain).
**Why no flags.** The Nemotron scripts carry a [`[tool.hf-jobs]` header](https://huggingface.co/docs/hub/jobs-configuration#define-the-launch-config-in-the-script) that sets the GPU, image and secrets. The other scripts have no header yet and take flags, as in the MOSS command. `hf jobs uv run --dry-run