- Automating Workflows with n8n and Local LLMs
- Generating Images with ComfyUI and Z Image Turbo
- Local LLM Coding with VSCode and Qwen3-Coder
- Running and Serving LLMs with LM Studio
- Running LLMs on PyTorch with AMD ROCm™ Software
- Build a GitHub-to-Slack Development Digest with Agent Canvas
- Building Custom GPU Kernels with PyTorch and AMD ROCm™
- Building Your First Agent with GAIA
- Chatting with LLMs in Open WebUI
- Clustering Four Ryzen™ AI Halos with RCCL
- Clustering Four Ryzen™ AI Halos with RPC
- Clustering Two Ryzen™ AI Halos with RCCL
- Clustering Two Ryzen™ AI Halos with RPC
- Fine-Tuning LLMs with LLaMA Factory
- Fine-Tuning LLMs with PyTorch and AMD ROCm™ Software
- Fine-Tuning LLMs with Unsloth
- Getting Started with Lemonade
- Getting Started with Ollama
- Getting Started with OpenHands and a Local LLM
- Getting Started with vLLM
- Getting Started with Your Ryzen AI Halo (Project Zenith)
- Local Computer Vision with AMD Ryzen™ AI NPU
- Real-Time Speech-to-Speech Translation
- Remote Development with AMD Sync
- Running DeepSeek V4 Flash with ds4
- Running Hermes Agent Locally with Lemonade Server
- Running OpenClaw Locally with Lemonade Server
| AMD GPU Driver | Latest from Ryzen AI Developer Center |
| PyTorch | 2.13 |
| AMD GPU Driver | 26.8.1 (from Ryzen AI Developer Center) |
| PyTorch | 2.13 |
| AMD GPU Driver | Latest inbox driver |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Latest inbox driver |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Latest inbox driver |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | RSL 26.14 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | RSL 26.14 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | RSL 26.14 |
| PyTorch | 2.13.0 |
| AMD GPU Driver | Adrenalin 26.9.1 |
| PyTorch | 2.13.0 |
- Overview
- What You’ll Learn
- Why use real-time speech-to-speech translation?
- Setting the Memory Configuration
- Install AMD Software: Adrenalin Edition
- Advanced: increasing GPU memory (optional)
- Check for Software Updates
- Installing Software Prerequisites
- Set up the speech-to-speech demo
- Next Steps
- Resources
Real-Time Speech-to-Speech Translation
Build a real-time speech-to-speech translation on your local hardware.
Overview
The AMD ROCm™ software and PyTorch stack create a unified ecosystem for on-device AI. It works for both Windows and Linux with official support for a wide range of devices including Ryzen™ AI APUs and Radeon™ GPUs.
This playbook will teach you how to run low-latency, expressive, and private speech-to-speech translation entirely on the edge.
What You’ll Learn
- How to set up speech-to-speech environment
- How to write Python code to load and use speech-speech models
- How to run and experiment with the Gradio UI
Why use real-time speech-to-speech translation?
- Removes friction between translation and language barriers
- Conveys tone, emotion, and intent without awkward pauses
- Enables global collaboration and faster decision-making
Setting the Memory Configuration
Install AMD Software: Adrenalin Edition
Download and install the latest AMD Software: Adrenalin Edition from amd.com/en/products/software/adrenalin.html.
if command -v rocminfo >/dev/null 2>&1 && rocminfo | grep -q gfx; then echo "OK: GPU visible to ROCm"else echo "GPU not visible via rocminfo" >&2 exit 1fiAdvanced: increasing GPU memory (optional)
You may need to increase the memory allocated to the GPU to run certain larger models or longer contexts. These devices use unified memory — the GPU shares system RAM — so this means letting the GPU claim more of that shared pool. Leave roughly 20% of system RAM for the operating system. This step is optional; the default allocation is enough for most workloads.
On Windows, adjust the memory in AMD Software: Adrenalin Edition: open it and navigate to Performance → Tuning → AMD Variable Graphics Memory. Set the value you need and reboot for the change to take effect.

Backup method (BIOS). If your system does not show the Variable Graphics Memory option in Adrenalin (some OEM systems hide it), set the UMA Frame Buffer Size in the system BIOS/UEFI instead: reboot, enter setup (usually Del, F2, or Esc), find UMA Frame Buffer Size — also labeled Integrated Graphics or dedicated GPU memory, often under Advanced or AMD CBS → NBIO Common Options — set it to the size you need, save, and reboot. Menu names vary by vendor, and some BIOS do not expose it either.
On the AMD Ryzen™ AI Halo, adjust the shared memory in the pre-installed AMD Ryzen™ AI Developer Center: open it, go to the Settings tab, and under Graphics Performance Settings increase the Shared Video Memory slider. Click Apply Changes and reboot for the change to take effect.

On Linux, raise the shared GTT/TTM pool so the GPU can map more system memory. AMD recommends setting the minimum dedicated VRAM in the BIOS (0.5 GB) so the maximum is available as shared memory.
- Install the
amd-debug-toolshelper:
sudo apt install pipxpipx ensurepathpipx install amd-debug-tools- Query the current shared-memory limit:
amd-ttm- Raise it (value in GB — pick a size that leaves headroom for the OS):
amd-ttm --set <NUM>- Reboot for the change to take effect.
Check for Software Updates
Before starting, ensure your Ryzen AI Halo has the latest software installed. Open the AMD Ryzen™ AI Developer Center and check for available updates, both to the app itself and additional software.
Go to the Updates tab. If updates are available, install them and reboot before continuing.

Go to the Manage tab. If updates are available, install them and reboot before continuing.

Installing Software Prerequisites
Create a Virtual Environment
On Linux, open a terminal and run the following prompt to create a venv with ROCm+Pytorch already installed:
sudo apt updatesudo apt install -y python3-venvpython3 -m venv s2st-env --system-site-packagessource s2st-env/bin/activateGrant your user access to GPU devices (log out and back in for this to take effect):
sudo usermod -aG render,video $LOGNAMEOn Linux, open a terminal and run the following prompt to create a venv:
sudo apt updatesudo apt install -y python3-venvpython3 -m venv s2st-envsource s2st-env/bin/activateOn Windows, open a terminal in the directory of your choice and follow the commands to create a venv with ROCm+Pytorch already installed:
python -m venv s2st-env --system-site-packagess2st-env\Scripts\activateOn Windows, open a terminal in the directory of your choice and follow the commands to create a venv:
python -m venv s2st-envs2st-env\Scripts\activateInstalling Basic Dependencies
AMD GPU Driver
Update to the latest AMD GPU driver using AMD Software: Adrenalin Edition™.
- Open
AMD Software: Adrenalin Editionfrom your Start menu or system tray. - Navigate to Driver and Software, click Manage Updates.
- If an update is available, follow the prompts to download and install.
AMD GPU Driver
Install the AMD GPU Driver (amdgpu) using the Radeon Software for Linux (RSL) flow. For instructions for your distribution, see the ROCm installation at: Install the kernel driver.
For the driver itself, see Linux® Drivers for AMD Radeon™
PyTorch
Install PyTorch with AMD ROCm™ software support in the created virtual environment:
python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-gfx1151]==2.13.0+rocm10.0.0" "torchvision[device-gfx1151]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-gfx1150]==2.13.0+rocm10.0.0" "torchvision[device-gfx1150]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-gfx1152]==2.13.0+rocm10.0.0" "torchvision[device-gfx1152]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-gfx1100]==2.13.0+rocm10.0.0" "torchvision[device-gfx1100]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-gfx1201]==2.13.0+rocm10.0.0" "torchvision[device-gfx1201]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"For other devices, please refer to ROCm 10.0.0 Documentation for full instructions.
Additional Dependencies
Install m4t dependencies using pip:
pip install transformers==5.10.1 safetensors==0.6.2 tiktoken==0.12.0 accelerate soundfile==0.13.1 sentencepiece protobuf gradio "scipy>=1.15.3"Set up the speech-to-speech demo
Learn about seamless-m4t-v2
Check out the model card on Hugging Face for more information.
This is the technical architecture of the speech-speech models:
Download Scripts
This playbook includes ready-to-use scripts. Please download all of them to the same directory as the environment you created.
| Script | Description | Usage |
|---|---|---|
| Basic LLM text generation | python infer.py | |
| input1.wav | Example Audio file | N/A |
| Language Support File | N/A | |
| Intuitive UI for Speech Translation | python gradio_demo.py --no-share |
Starting with infer.py
To execute the script, run
python infer.pyExplaining the Code
Snippet 1: Importing the necessary dependencies
import osos.environ["HIP_VISIBLE_DEVICES"] = "0"
import timeimport numpy as npimport scipy.io.wavfileimport soundfile as sfimport torchimport torchaudio
from transformers import AutoProcessor, SeamlessM4Tv2Model
DEFAULT_TARGET_LANGUAGE = "eng"
INPUT_AUDIO_PATH = "./input1.wav"OUTPUT_AUDIO_PATH = "./out1.wav"
# Automatically downloads + caches via Hugging FaceMODEL_ID = "facebook/seamless-m4t-v2-large"
TARGET_SAMPLE_RATE = 16_000Snippet 2: Loading the models from HuggingFace
This function takes in a model ID and downloads the model if not already downloaded. It then returns the processor and model for the next function to use.
def load_model(model_id: str, device: torch.device): start = time.time()
print("Loading model (downloads automatically on first run)...")
processor = AutoProcessor.from_pretrained(model_id)
dtype = torch.float16 if device.type == "cuda" else torch.float32
model = SeamlessM4Tv2Model.from_pretrained(model_id, torch_dtype=dtype).to(device)
elapsed = time.time() - start print(f"Model loading duration: {elapsed:.2f} seconds")
return processor, modelSnippet 3: Input audio clip .wav file and preprocess it
This function loads the audio clip and resamples it to the target rate.
def preprocess_audio(audio_path: str, target_sr: int = TARGET_SAMPLE_RATE) -> torch.Tensor:
audio_np, orig_freq = sf.read(audio_path, dtype="float32", always_2d=True)
# Convert to tensor [channels, samples] audio = torch.from_numpy(audio_np.T)
# Resample if needed if orig_freq != target_sr: audio = torchaudio.functional.resample(audio, orig_freq=orig_freq, new_freq=target_sr)
# Convert stereo -> mono if audio.shape[0] > 1: audio = torch.mean(audio, dim=0, keepdim=True)
return audioSnippet 4: Run inference
This function runs inference with the model and returns the generated output.
def run_inference(model, processor, audio: torch.Tensor, device: torch.device, target_lang: str = DEFAULT_TARGET_LANGUAGE):
start = time.time()
audio_inputs = processor( audio=audio.squeeze(0).cpu().numpy(), sampling_rate=TARGET_SAMPLE_RATE, return_tensors="pt", )
audio_inputs = { k: v.to(device) if isinstance(v, torch.Tensor) else v for k, v in audio_inputs.items() }
with torch.inference_mode(): output = model.generate(**audio_inputs, tgt_lang=target_lang)[0]
audio_array = output.float().cpu().numpy().squeeze()
elapsed = time.time() - start print(f"Inference duration: {elapsed:.2f} seconds")
return audio_array, elapsedSnippet 5: Save the translated file
This function saves the audio array to a .WAV file.
def save_audio(audio_array: np.ndarray, output_path: str, sample_rate: int): if np.issubdtype(audio_array.dtype, np.floating): max_abs = np.max(np.abs(audio_array)) if audio_array.size else 0.0
if max_abs > 1.0: audio_array = audio_array / max_abs
audio_array = (audio_array * 32767.0).clip(-32768, 32767).astype(np.int16)
scipy.io.wavfile.write(output_path, rate=sample_rate, data=audio_array)
print(f"Output saved to: {output_path}")Running the Gradio UI demo:
Now that you have run a basic script example, the following instructions provide a helpful UI that builds upon the code we have written and makes live speech-speech translation easy.
Run Gradio Locally
python ./gradio_demo.py --no-shareThen, open your web browser at http://127.0.0.1:7860 to access the UI.
Gradio UI example:

Next Steps
- Mix and match between dozens of languages for quick translation.
- Share your demo with others: Add —share to create a public link that anyone can access remotely, or deploy permanently using Hugging Face Spaces
Resources
Below are some additional resources to learn more about speech-to-speech translation:
- The repo is here https://huggingface.co/facebook/seamless-m4t-v2-large
- Research academia related to “Seamless: Multilingual Expressive and Streaming Speech Translation”
- Gradio sharing and deployment: Sharing Your App Guide and Deploy to Hugging Face Spaces
Need help with this playbook?
Run into an issue or have a question? Open a GitHub issue and our team will take a look.