Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,25 +1,24 @@
|
|
| 1 |
-
|
| 2 |
-
# app.py (2025-05 rev, aligned with latest sonic.py)
|
| 3 |
-
# ---------------------------------------------------------
|
| 4 |
-
import os, io, hashlib, numpy as np, gradio as gr, spaces
|
| 5 |
from pydub import AudioSegment
|
| 6 |
from PIL import Image
|
| 7 |
from sonic import Sonic
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
# 1)
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# ------------------------------------------------------------------
|
| 25 |
def md5(b: bytes) -> str: # 빠른 32-byte 해시
|
|
|
|
| 1 |
+
import os, io, hashlib, gradio as gr, spaces
|
|
|
|
|
|
|
|
|
|
| 2 |
from pydub import AudioSegment
|
| 3 |
from PIL import Image
|
| 4 |
from sonic import Sonic
|
| 5 |
|
| 6 |
+
# --------------------------------------------------------------
|
| 7 |
+
# 1) 필요 체크포인트(두 개)만 받는다
|
| 8 |
+
# --------------------------------------------------------------
|
| 9 |
+
DL_CMDS = [
|
| 10 |
+
# Sonic(가중치, unet 등)
|
| 11 |
+
"huggingface-cli download LeonJoe13/Sonic --local-dir checkpoints/LeonJoe13-Sonic --local-dir-use-symlinks False -q",
|
| 12 |
+
# stable-video-diffusion-img2vid-xt (VAE/UNet/CLIP)
|
| 13 |
+
"huggingface-cli download stabilityai/stable-video-diffusion-img2vid-xt "
|
| 14 |
+
"--local-dir checkpoints/stable-video-diffusion-img2vid-xt --local-dir-use-symlinks False -q",
|
| 15 |
+
# whisper-tiny
|
| 16 |
+
"huggingface-cli download openai/whisper-tiny --local-dir checkpoints/whisper-tiny --local-dir-use-symlinks False -q",
|
| 17 |
+
]
|
| 18 |
+
for cmd in DL_CMDS:
|
| 19 |
+
os.system(cmd)
|
| 20 |
+
|
| 21 |
+
pipe = Sonic() # 위에서 모델 경로를 자동으로 찾음
|
| 22 |
|
| 23 |
# ------------------------------------------------------------------
|
| 24 |
def md5(b: bytes) -> str: # 빠른 32-byte 해시
|