sergipastor commited on
Commit
1c6b6d5
·
1 Parent(s): e07d177
Files changed (2) hide show
  1. Dockerfile +0 -6
  2. app.py +2 -5
Dockerfile CHANGED
@@ -7,17 +7,11 @@ ENV PATH="/home/user/.local/bin:$PATH"
7
  WORKDIR /app
8
  COPY . /app
9
 
10
- # RUN apt-get update && apt-get install -y \
11
- # git \
12
- # && rm -rf /var/lib/apt/lists/*
13
-
14
  RUN git clone https://github.com/serkansulun/midi-emotion.git /app/midi-emotion
15
 
16
  COPY --chown=user ./requirements.txt requirements.txt
17
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
- RUN touch /app/midi-emotion/__init__.py
20
- RUN touch /app/midi-emotion/src/__init__.py
21
  RUN ls /app/midi-emotion
22
  RUN ls /app/midi-emotion/src
23
 
 
7
  WORKDIR /app
8
  COPY . /app
9
 
 
 
 
 
10
  RUN git clone https://github.com/serkansulun/midi-emotion.git /app/midi-emotion
11
 
12
  COPY --chown=user ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
 
 
15
  RUN ls /app/midi-emotion
16
  RUN ls /app/midi-emotion/src
17
 
app.py CHANGED
@@ -1,8 +1,4 @@
1
- import sys
2
- sys.path.append('/app/midi-emotion')
3
-
4
- from midi_emotion.src.utils import split_list
5
-
6
  from fastapi import FastAPI
7
 
8
  app = FastAPI()
@@ -14,4 +10,5 @@ def greet_json():
14
 
15
  @app.get("/generate")
16
  def generate(arousal: float, valence: float):
 
17
  return {"arousal": arousal, "valence": valence}
 
1
+ import subprocess
 
 
 
 
2
  from fastapi import FastAPI
3
 
4
  app = FastAPI()
 
10
 
11
  @app.get("/generate")
12
  def generate(arousal: float, valence: float):
13
+ subprocess.run(["python", "/app/midi-emotion/src/generate.py", "-h"])
14
  return {"arousal": arousal, "valence": valence}