Spaces:
Runtime error
Runtime error
hf-lin
commited on
Commit
•
eac8ee9
1
Parent(s):
d49b1a7
gradio SDK
Browse files- Dockerfile +0 -15
- app.py +3 -1
- packages.txt +2 -0
Dockerfile
DELETED
@@ -1,15 +0,0 @@
|
|
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
|
9 |
-
RUN apt install fuse libfuse2
|
10 |
-
|
11 |
-
COPY . .
|
12 |
-
RUN chmod +x MuseScore-4.1.1.232071203-x86_64.AppImage
|
13 |
-
RUN mkdir -m 700 flagged
|
14 |
-
|
15 |
-
CMD ["uvicorn", "app:gradio_app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
@@ -14,6 +14,8 @@ from symusic import Score, Synthesizer
|
|
14 |
import spaces
|
15 |
|
16 |
os.environ['QT_QPA_PLATFORM']='offscreen'
|
|
|
|
|
17 |
torch.backends.cuda.enable_mem_efficient_sdp(False)
|
18 |
torch.backends.cuda.enable_flash_sdp(False)
|
19 |
|
@@ -284,7 +286,7 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
284 |
|
285 |
model = AutoModelForCausalLM.from_pretrained(
|
286 |
MODEL_PATH,
|
287 |
-
device_map='
|
288 |
).eval()
|
289 |
|
290 |
model.generation_config = GenerationConfig.from_pretrained(
|
|
|
14 |
import spaces
|
15 |
|
16 |
os.environ['QT_QPA_PLATFORM']='offscreen'
|
17 |
+
subprocess.run("chmod +x MuseScore-4.1.1.232071203-x86_64.AppImage", shell=True)
|
18 |
+
|
19 |
torch.backends.cuda.enable_mem_efficient_sdp(False)
|
20 |
torch.backends.cuda.enable_flash_sdp(False)
|
21 |
|
|
|
286 |
|
287 |
model = AutoModelForCausalLM.from_pretrained(
|
288 |
MODEL_PATH,
|
289 |
+
device_map='cuda'
|
290 |
).eval()
|
291 |
|
292 |
model.generation_config = GenerationConfig.from_pretrained(
|
packages.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fuse
|
2 |
+
libfuse2
|