# Transcribe audio with Whisper

You will upload a recording to a GPU server and turn it into text with Whisper, a speech-recognition model. The **Whisper transcription** template installs `ffmpeg` and `faster-whisper` and puts a ready script at `/workspace/transcribe.py`. You work in a terminal, so you need an SSH key. If you have none, see [Connect with SSH](/docs/connect-ssh).

## 1. Deploy the server

1. Open **Deploy**. Pick a GPU with **VRAM** of 8 GB or more, sorted by **Price, low to high**, and select **Continue**.
2. Select the **Whisper transcription** card, then **Continue**.
3. Name the server `whisper-test` and select your key under **SSH keys**.
4. Check **Per hour** on the review step and select **Start my server**.

## 2. Connect and check the tools

When the status is **Running**, open the server, select the **Connect** tab and copy the SSH command. Run it in a terminal. The template sets up its tools at the start, so check that they are ready:

```bash
ls /workspace/transcribe.py
python -c "import faster_whisper; print('ready')"
```

You should see the file name and `ready`. If an error appears, wait a minute and run the commands again.

## 3. Upload your recording

On your own computer, copy the file into the `audio` folder. Replace `PORT` and `HOST` with the values on the **Connect** tab:

```bash
scp -P PORT ./meeting.mp3 root@HOST:/workspace/audio/
```

If your file is a video, extract the sound on the server first. `ffmpeg` is installed:

```bash
ffmpeg -i /workspace/audio/talk.mp4 -vn -ac 1 -ar 16000 /workspace/audio/talk.wav
```

## 4. Transcribe

On the server, run the script on your file and keep the result in a text file:

```bash
python /workspace/transcribe.py /workspace/audio/meeting.mp3 | tee /workspace/transcripts/meeting.txt
```

The first run downloads the `large-v3` model, a few gigabytes, so it waits longer before the first line appears. Later runs on the same disk reuse it. Each line of the result has the start and end time in seconds, then the text. This is the shape of the output, not your content:

```text
[0.00 -> 4.20] Welcome everyone, let's get started.
[4.20 -> 9.80] First on the agenda is the budget.
```

The language is detected for you. The GPU is only busy while the command runs.

## 5. Several files

To transcribe every file in the folder, one after another:

```bash
for f in /workspace/audio/*; do
  python /workspace/transcribe.py "$f" > "/workspace/transcripts/$(basename "$f").txt"
done
```

The script loads the model again for each file. For a very long list, run the loop inside `tmux` so closing your laptop does not stop it.

## 6. Get the transcripts

On your own computer:

```bash
scp -P PORT 'root@HOST:/workspace/transcripts/*.txt' ./
```

More ways to copy data are in [Moving files](/docs/moving-files).

## Costs

You pay for the time the server runs, not for the minutes of audio. The price per hour is on the card in **Deploy** and on the review step. Upload everything first, run the transcription in one go, then stop the server.

## When you are done: stop or delete

- **Stop** ends the compute charge. The disk with your audio, transcripts and the downloaded model is kept and still charged.
- **Destroy** ends every charge and deletes the disk. Download the transcripts first, and delete recordings you no longer need. See [Start, stop and restart](/docs/start-stop-restart).

## Next

- [Move data in and out](/docs/tutorial-move-data)
- [Common mistakes and how to fix them](/docs/tutorial-common-mistakes)
