Views
No views yet
1import torch
2from transformers import pipeline
3
4# Load the pipeline
5audio_llm = pipeline(
6 "text-generation",
7 model="cdreetz/audio-llama-hf",
8 device="cuda" if torch.cuda.is_available() else "cpu"
9)
10
11# Process audio file
12result = audio_llm("path/to/audio.wav")
13print(result[0]["generated_text"])
14
15# Process audio with custom prompt
16result = audio_llm(("path/to/audio.wav", "Describe the music in this audio:"))
17print(result[0]["generated_text"])
18
19# Text-only generation
20result = audio_llm("Write a poem about sound:")
21print(result[0]["generated_text"])example.py for more advanced usage examples.