{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching 5 files: 100%|██████████| 5/5 [00:00<00:00, 76818.75it/s]\n",
" 0%| | 0/50 [01:05, ?it/s]\n"
]
},
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import torchaudio\n",
"from tangoflux import TangoFluxInference\n",
"from IPython.display import Audio\n",
"\n",
"model = TangoFluxInference(name=\"declare-lab/TangoFlux\")\n",
"\n",
"\n",
"audio = model.generate(\"Hammer slowly hitting the wooden table\", steps=50, duration=10)\n",
"\n",
"Audio(data=audio, rate=44100)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"torchaudio.save(\"temp.wav\", audio, sample_rate=44100)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "flux",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}