Ken Lin
commited on
Commit
•
4c5a4b0
1
Parent(s):
02d48a9
delete model
Browse files- app.py +6 -0
- ram_swin_large_14m.pth +0 -3
app.py
CHANGED
@@ -6,8 +6,14 @@ title = "Musicalization System of Painting Demo"
|
|
6 |
description = "Pui Ching Middle School: Musicalization System of Painting Demo"
|
7 |
|
8 |
def generate_music(text):
|
|
|
|
|
|
|
|
|
9 |
processor = AutoProcessor.from_pretrained("facebook/musicgen-small")
|
10 |
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
|
|
|
|
|
11 |
|
12 |
inputs = processor(
|
13 |
text=[text],
|
|
|
6 |
description = "Pui Ching Middle School: Musicalization System of Painting Demo"
|
7 |
|
8 |
def generate_music(text):
|
9 |
+
tag2text_checkpoint = "./tag2text_swin_14m.pth"
|
10 |
+
tag2text_model = tag2text(pretrained=tag2text_checkpoint, image_size=image_size, vit='swin_b').eval().to(device)
|
11 |
+
res = inference_tag2text(image, tagging_model, specified_tags)
|
12 |
+
|
13 |
processor = AutoProcessor.from_pretrained("facebook/musicgen-small")
|
14 |
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
|
15 |
+
|
16 |
+
|
17 |
|
18 |
inputs = processor(
|
19 |
text=[text],
|
ram_swin_large_14m.pth
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:15c729c793af28b9d107c69f85836a1356d76ea830d4714699fb62e55fcc08ed
|
3 |
-
size 5625634877
|
|
|
|
|
|
|
|