seungheondoh
commited on
Commit
β’
a88e2b0
1
Parent(s):
ab464b2
update
Browse files
app.py
CHANGED
@@ -11,12 +11,13 @@ from utils.audio_utils import load_audio, STR_CH_FIRST
|
|
11 |
|
12 |
if os.path.isfile("transfer.pth") == False:
|
13 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/transfer.pth', 'transfer.pth')
|
|
|
14 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/electronic.mp3', 'electronic.mp3')
|
15 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/orchestra.wav', 'orchestra.wav')
|
16 |
|
17 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
18 |
|
19 |
-
example_list = ['electronic.mp3', 'orchestra.wav']
|
20 |
model = BartCaptionModel(max_length = 128)
|
21 |
pretrained_object = torch.load('./transfer.pth', map_location='cpu')
|
22 |
state_dict = pretrained_object['state_dict']
|
@@ -65,10 +66,10 @@ title = "Interactive demo: Music Captioning π€π΅"
|
|
65 |
description = """
|
66 |
<p style='text-align: center'> LP-MusicCaps: LLM-Based Pseudo Music Captioning</p>
|
67 |
<p style='text-align: center'> SeungHeon Doh, Keunwoo Choi, Jongpil Lee, Juhan Nam, ISMIR 2023</p>
|
68 |
-
<p style='text-align: center'> <a href='#' target='_blank'>ArXiv</a> | <a href='https://github.com/seungheondoh/lp-music-caps' target='_blank'>
|
69 |
<p style='text-align: center'> To use it, simply upload your audio and click 'submit', or click one of the examples to load them. Read more at the links below. </p>
|
70 |
"""
|
71 |
-
article = "<p style='text-align: center'><a href='https://github.
|
72 |
|
73 |
|
74 |
demo = gr.Interface(fn=captioning,
|
|
|
11 |
|
12 |
if os.path.isfile("transfer.pth") == False:
|
13 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/transfer.pth', 'transfer.pth')
|
14 |
+
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/folk.wav', 'folk.wav')
|
15 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/electronic.mp3', 'electronic.mp3')
|
16 |
torch.hub.download_url_to_file('https://huggingface.co/seungheondoh/lp-music-caps/resolve/main/orchestra.wav', 'orchestra.wav')
|
17 |
|
18 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
19 |
|
20 |
+
example_list = ['folk.wav', 'electronic.mp3', 'orchestra.wav']
|
21 |
model = BartCaptionModel(max_length = 128)
|
22 |
pretrained_object = torch.load('./transfer.pth', map_location='cpu')
|
23 |
state_dict = pretrained_object['state_dict']
|
|
|
66 |
description = """
|
67 |
<p style='text-align: center'> LP-MusicCaps: LLM-Based Pseudo Music Captioning</p>
|
68 |
<p style='text-align: center'> SeungHeon Doh, Keunwoo Choi, Jongpil Lee, Juhan Nam, ISMIR 2023</p>
|
69 |
+
<p style='text-align: center'> <a href='#' target='_blank'>ArXiv</a> | <a href='https://github.com/seungheondoh/lp-music-caps' target='_blank'>Codes</a> | <a href='https://github.com/seungheondoh/lp-music-caps' target='_blank'>Dataset</a> </p>
|
70 |
<p style='text-align: center'> To use it, simply upload your audio and click 'submit', or click one of the examples to load them. Read more at the links below. </p>
|
71 |
"""
|
72 |
+
article = "<p style='text-align: center'><a href='https://seungheondoh.github.io/' target='_blank'>Author Info</a> | <a href='https://github.com/seungheondoh' target='_blank'>Github</a></p>"
|
73 |
|
74 |
|
75 |
demo = gr.Interface(fn=captioning,
|