Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import torch
|
| 4 |
import os
|
|
@@ -20,7 +23,23 @@ def print_memory_info():
|
|
| 20 |
logger.info(f"Free CPU Memory: {free_cpu_mem:.2f} GB")
|
| 21 |
logger.info(f"Free GPU Memory: {free_gpu_mem:.2f} GB")
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
@st.cache_resource
|
| 25 |
def load_image_model():
|
| 26 |
torch.cuda.empty_cache()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from flask.Emotion_spotting_service import _Emotion_spotting_service
|
| 3 |
+
from flask.Genre_spotting_service import _Genre_spotting_service
|
| 4 |
+
from flask.Beat_tracking_service import _Beat_tracking_service
|
| 5 |
from diffusers import StableDiffusionPipeline
|
| 6 |
import torch
|
| 7 |
import os
|
|
|
|
| 23 |
logger.info(f"Free CPU Memory: {free_cpu_mem:.2f} GB")
|
| 24 |
logger.info(f"Free GPU Memory: {free_gpu_mem:.2f} GB")
|
| 25 |
|
| 26 |
+
emo_list = []
|
| 27 |
+
gen_list = []
|
| 28 |
+
tempo_list = []
|
| 29 |
+
@st.cache_resource
|
| 30 |
+
def load_emo_model():
|
| 31 |
+
emo_service = _Emotion_spotting_service("flask/emotion_model.h5")
|
| 32 |
+
return emo_service
|
| 33 |
+
@st.cache_resource
|
| 34 |
+
def load_genre_model():
|
| 35 |
+
gen_service = _Genre_spotting_service("flask/Genre_classifier_model.h5")
|
| 36 |
+
return gen_service
|
| 37 |
|
| 38 |
+
@st.cache_resource
|
| 39 |
+
def load_beat_model():
|
| 40 |
+
beat_service = _Beat_tracking_service()
|
| 41 |
+
return beat_service
|
| 42 |
+
|
| 43 |
@st.cache_resource
|
| 44 |
def load_image_model():
|
| 45 |
torch.cuda.empty_cache()
|