Spaces:
Runtime error
Runtime error
hf-lin
commited on
Commit
·
01fd204
1
Parent(s):
2cf0385
pdf version
Browse files- Dockerfile +1 -9
- app.py +3 -3
Dockerfile
CHANGED
@@ -1,21 +1,13 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
ENV HOME=/home
|
4 |
WORKDIR /code
|
5 |
|
6 |
COPY ./requirements.txt /code/requirements.txt
|
7 |
|
8 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
9 |
-
RUN apt update && apt install -y fuse libfuse2
|
10 |
-
RUN apt install --assume-yes apt-utils \
|
11 |
-
&& apt install --assume-yes software-properties-common \
|
12 |
-
&& apt install --assume-yes dbus \
|
13 |
-
&& apt install --assume-yes glib-networking \
|
14 |
-
&& apt install --assume-yes dconf-cli \
|
15 |
-
&& apt install --assume-yes fontconfig
|
16 |
|
17 |
COPY . .
|
18 |
RUN chmod +x MuseScore-4.1.1.232071203-x86_64.AppImage
|
19 |
-
RUN mkdir -m 700 flagged
|
20 |
|
21 |
CMD ["uvicorn", "app:gradio_app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
3 |
WORKDIR /code
|
4 |
|
5 |
COPY ./requirements.txt /code/requirements.txt
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
+
RUN apt update && apt install -y fuse libfuse2
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
COPY . .
|
11 |
RUN chmod +x MuseScore-4.1.1.232071203-x86_64.AppImage
|
|
|
12 |
|
13 |
CMD ["uvicorn", "app:gradio_app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
os.environ['QT_QPA_PLATFORM']='offscreen'
|
3 |
-
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
|
4 |
|
5 |
import re
|
6 |
import subprocess
|
@@ -36,9 +36,9 @@ def parse_abc_notation(text='', conversation_id='debug'):
|
|
36 |
# Convert abc notation to SVG
|
37 |
tmp_midi = f'{ts}.mid'
|
38 |
s.dump_midi(tmp_midi)
|
39 |
-
svg_file = f'{ts}.
|
40 |
subprocess.run(["./MuseScore-4.1.1.232071203-x86_64.AppImage", "-f", "-o", svg_file, tmp_midi])
|
41 |
-
return
|
42 |
else:
|
43 |
return None, None
|
44 |
|
|
|
1 |
import os
|
2 |
os.environ['QT_QPA_PLATFORM']='offscreen'
|
3 |
+
# os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
|
4 |
|
5 |
import re
|
6 |
import subprocess
|
|
|
36 |
# Convert abc notation to SVG
|
37 |
tmp_midi = f'{ts}.mid'
|
38 |
s.dump_midi(tmp_midi)
|
39 |
+
svg_file = f'{ts}.pdf'
|
40 |
subprocess.run(["./MuseScore-4.1.1.232071203-x86_64.AppImage", "-f", "-o", svg_file, tmp_midi])
|
41 |
+
return svg_file, wav_file
|
42 |
else:
|
43 |
return None, None
|
44 |
|