sheikyerbouti hmartiros commited on
Commit
34bba79
0 Parent(s):

Duplicate from riffusion/riffusion-playground

Browse files

Co-authored-by: Hayk Martiros <hmartiros@users.noreply.huggingface.co>

Files changed (7) hide show
  1. .gitattributes +34 -0
  2. .gitmodules +3 -0
  3. README.md +14 -0
  4. app.py +36 -0
  5. packages.txt +3 -0
  6. requirements.txt +17 -0
  7. riffusion +1 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitmodules ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [submodule "riffusion"]
2
+ path = riffusion
3
+ url = https://github.com/riffusion/riffusion
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Riffusion Playground
3
+ emoji: 📚
4
+ colorFrom: red
5
+ colorTo: purple
6
+ sdk: streamlit
7
+ sdk_version: 1.15.2
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ duplicated_from: riffusion/riffusion-playground
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Shim layer for using the riffusion playground streamlit app with huggingface spaces.
3
+
4
+ It doesn't support the pages feature of streamlit yet.
5
+ """
6
+ import importlib
7
+ from pathlib import Path
8
+ import sys
9
+
10
+ import streamlit as st
11
+
12
+
13
+ def render_main():
14
+ RIFFUSION_PATH = Path(__file__).parent / "riffusion"
15
+ sys.path.append(str(RIFFUSION_PATH))
16
+
17
+ st.set_page_config(layout="wide", page_icon="🎸")
18
+
19
+ # Disable the rest of the setting
20
+ st.set_page_config = lambda **kwargs: None
21
+
22
+ # Find all pages in the riffusion directory
23
+ pages = sorted(
24
+ p.name[:-3] for p in (RIFFUSION_PATH / "riffusion" / "streamlit" / "pages").glob("*.py")
25
+ )
26
+
27
+ # Add the pages to the sidebar
28
+ page = st.sidebar.selectbox("Page", pages, index=pages.index("text_to_audio"))
29
+ assert page is not None
30
+
31
+ module = importlib.import_module(f"riffusion.streamlit.pages.{page}")
32
+ render_func = getattr(module, f"render_{page}")
33
+ render_func()
34
+
35
+
36
+ render_main()
packages.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ffmpeg
2
+ libsndfile1
3
+
requirements.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate
2
+ argh
3
+ dacite
4
+ diffusers
5
+ flask
6
+ flask_cors
7
+ numpy
8
+ pillow
9
+ plotly
10
+ pydub
11
+ scipy
12
+ soundfile
13
+ sox
14
+ streamlit
15
+ torch
16
+ torchaudio
17
+ transformers
riffusion ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 6b02e98e35cd2e4f3a5777fd287ede7be40a8976