DanLeBossDeESGI commited on
Commit
f970764
·
1 Parent(s): d994978

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -29
app.py CHANGED
@@ -1,29 +1 @@
1
- import streamlit as st
2
-
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
5
-
6
- git add app.py
7
- git commit -m "Add application file"
8
- git push
9
-
10
- pip install git+https://github.com/facebookresearch/audiocraft.git
11
-
12
- apt get install ffmpeg
13
-
14
- import torchaudio
15
- from audiocraft.models import MusicGen
16
- from audiocraft.data.audio import audio_write
17
-
18
- model = MusicGen.get_pretrained('melody')
19
- model.set_generation_params(duration=8) # generate 8 seconds.
20
-
21
- descriptions = ['happy rock', 'energetic EDM', 'sad jazz']
22
-
23
- melody, sr = torchaudio.load('./assets/bach.mp3')
24
- # generates using the melody from the given audio and the provided descriptions.
25
- wav = model.generate_with_chroma(descriptions, melody[None].expand(3, -1, -1), sr)
26
-
27
- for idx, one_wav in enumerate(wav):
28
- # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.
29
- audio_write(f'{idx}', one_wav.cpu(), model.sample_rate, strategy="loudness")
 
1
+ print("Hello World");