Spaces:
Running
Running
updated dockerfile for gdbm
Browse files- Dockerfile +21 -20
- app_utils/conf.py +2 -2
Dockerfile
CHANGED
|
@@ -1,46 +1,47 @@
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.8-slim
|
| 3 |
|
|
|
|
|
|
|
| 4 |
# Set the working directory to /app
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# Install any needed packages specified in requirements.txt
|
| 11 |
RUN pip install --trusted-host pypi.python.org -r requirements.txt && \
|
| 12 |
pip uninstall transformers && \
|
| 13 |
pip install transformers==4.29.2
|
| 14 |
|
| 15 |
-
RUN --mount=type=cache,target=/home/user/.cache/
|
| 16 |
|
| 17 |
# Make port 80 available to the world outside this container
|
| 18 |
EXPOSE 80
|
| 19 |
|
| 20 |
# Set the TORTOISE_MODELS_DIR environment variable
|
| 21 |
-
ENV TORTOISE_MODELS_DIR tortoise/models/pretrained_models
|
| 22 |
-
|
| 23 |
-
ENV DBM_TYPE=dbm.ndbm
|
| 24 |
-
|
| 25 |
|
| 26 |
# Create the directory for pretrained models
|
| 27 |
# RUN mkdir -p $TORTOISE_MODELS_DIR
|
| 28 |
|
| 29 |
-
RUN echo "Downloading models through docker container..."
|
| 30 |
-
|
| 31 |
-
# Download all the models
|
| 32 |
-
RUN wget -O $TORTOISE_MODELS_DIR/autoregressive.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/autoregressive.pth && \
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
RUN echo "Finished downloading models through docker container..."
|
| 44 |
|
| 45 |
RUN echo "Current directory contents:"
|
| 46 |
RUN ls -la
|
|
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.8-slim
|
| 3 |
|
| 4 |
+
COPY --chown=user --from=stage /home/user/.cache /home/user/.cache
|
| 5 |
+
|
| 6 |
# Set the working directory to /app
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
# Copy the current directory contents into the container at /app
|
| 10 |
COPY . /app
|
| 11 |
|
| 12 |
+
RUN apt-get update -y
|
| 13 |
+
RUN apt-get install -y python-gdbm
|
| 14 |
# Install any needed packages specified in requirements.txt
|
| 15 |
RUN pip install --trusted-host pypi.python.org -r requirements.txt && \
|
| 16 |
pip uninstall transformers && \
|
| 17 |
pip install transformers==4.29.2
|
| 18 |
|
| 19 |
+
# RUN --mount=type=cache,target=/home/user/.cache/
|
| 20 |
|
| 21 |
# Make port 80 available to the world outside this container
|
| 22 |
EXPOSE 80
|
| 23 |
|
| 24 |
# Set the TORTOISE_MODELS_DIR environment variable
|
| 25 |
+
# ENV TORTOISE_MODELS_DIR tortoise/models/pretrained_models
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Create the directory for pretrained models
|
| 28 |
# RUN mkdir -p $TORTOISE_MODELS_DIR
|
| 29 |
|
| 30 |
+
# RUN echo "Downloading models through docker container..."
|
| 31 |
+
|
| 32 |
+
# # Download all the models
|
| 33 |
+
# RUN wget -O $TORTOISE_MODELS_DIR/autoregressive.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/autoregressive.pth && \
|
| 34 |
+
# wget -O $TORTOISE_MODELS_DIR/classifier.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/classifier.pth && \
|
| 35 |
+
# wget -O $TORTOISE_MODELS_DIR/clvp2.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/clvp2.pth && \
|
| 36 |
+
# wget -O $TORTOISE_MODELS_DIR/cvvp.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/cvvp.pth && \
|
| 37 |
+
# wget -O $TORTOISE_MODELS_DIR/diffusion_decoder.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/diffusion_decoder.pth && \
|
| 38 |
+
# wget -O $TORTOISE_MODELS_DIR/vocoder.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/vocoder.pth && \
|
| 39 |
+
# wget -O $TORTOISE_MODELS_DIR/rlg_auto.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/rlg_auto.pth && \
|
| 40 |
+
# wget -O $TORTOISE_MODELS_DIR/rlg_diffuser.pth https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/rlg_diffuser.pth && \
|
| 41 |
+
# wget -O $TORTOISE_MODELS_DIR/bigvgan_base_24khz_100band_g.pth https://drive.google.com/uc?id=1_cKskUDuvxQJUEBwdgjAxKuDTUW6kPdY && \
|
| 42 |
+
# wget -O $TORTOISE_MODELS_DIR/bigvgan_24khz_100band_g.pth https://drive.google.com/uc?id=1wmP_mAs7d00KHVfVEl8B5Gb72Kzpcavp
|
| 43 |
+
|
| 44 |
+
# RUN echo "Finished downloading models through docker container..."
|
| 45 |
|
| 46 |
RUN echo "Current directory contents:"
|
| 47 |
RUN ls -la
|
app_utils/conf.py
CHANGED
|
@@ -15,14 +15,14 @@ class PersistentSettings(BaseModel):
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
def __init__(self, **data: Any):
|
| 18 |
-
with shelve.open("config.db", flag="n", protocol=2) as db:
|
| 19 |
super().__init__(**db.get("settings", default={}), **data)
|
| 20 |
|
| 21 |
def update(self, **data: Any) -> None:
|
| 22 |
"""
|
| 23 |
Persist the pydantic-dict that represents the model
|
| 24 |
"""
|
| 25 |
-
with shelve.open("config.db", flag="n", protocol=2) as db:
|
| 26 |
db["settings"] = {**self.dict(), **data}
|
| 27 |
|
| 28 |
|
|
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
def __init__(self, **data: Any):
|
| 18 |
+
with shelve.open("config.db", flag="n", protocol=2, writeback=False,) as db:
|
| 19 |
super().__init__(**db.get("settings", default={}), **data)
|
| 20 |
|
| 21 |
def update(self, **data: Any) -> None:
|
| 22 |
"""
|
| 23 |
Persist the pydantic-dict that represents the model
|
| 24 |
"""
|
| 25 |
+
with shelve.open("config.db", flag="n", protocol=2, writeback=False,) as db:
|
| 26 |
db["settings"] = {**self.dict(), **data}
|
| 27 |
|
| 28 |
|