Spaces:
Sleeping
Sleeping
nam pham
commited on
Commit
·
274ad8e
1
Parent(s):
5e5906f
fix: don't predict
Browse files- Dockerfile +2 -1
- app/server.py +2 -3
Dockerfile
CHANGED
@@ -19,7 +19,8 @@ FROM python:$PYTHON_VERSION-slim as runtime
|
|
19 |
####### Add your own installation commands here #######
|
20 |
# Create necessary directories with proper permissions
|
21 |
RUN mkdir -p /app/cache && chmod 777 /app/cache && \
|
22 |
-
mkdir -p /app/output && chmod 777 /app/output
|
|
|
23 |
|
24 |
# Create user first
|
25 |
RUN useradd -m -u 1000 user
|
|
|
19 |
####### Add your own installation commands here #######
|
20 |
# Create necessary directories with proper permissions
|
21 |
RUN mkdir -p /app/cache && chmod 777 /app/cache && \
|
22 |
+
mkdir -p /app/output && chmod 777 /app/output && \
|
23 |
+
chown -R user:user /app/output /app/cache
|
24 |
|
25 |
# Create user first
|
26 |
RUN useradd -m -u 1000 user
|
app/server.py
CHANGED
@@ -107,9 +107,8 @@ class KokoroAPI(ls.LitAPI):
|
|
107 |
generator = self.pipeline(text, voice=voice, speed=1, split_pattern=r"\n+")
|
108 |
|
109 |
# Create the output directory if it does not exist
|
110 |
-
output_dir =
|
111 |
-
|
112 |
-
os.makedirs(output_dir)
|
113 |
|
114 |
# Save each audio file
|
115 |
for i, (gs, ps, audio) in enumerate(generator):
|
|
|
107 |
generator = self.pipeline(text, voice=voice, speed=1, split_pattern=r"\n+")
|
108 |
|
109 |
# Create the output directory if it does not exist
|
110 |
+
output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'output')
|
111 |
+
os.makedirs(output_dir, exist_ok=True)
|
|
|
112 |
|
113 |
# Save each audio file
|
114 |
for i, (gs, ps, audio) in enumerate(generator):
|