You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to start a tortoise server by writing a docker file installing tortoise and other dependencies, and a python script to run the server, but it always shows error:
File "/opt/program/predictor.py", line 11, in <module>
tts = TextToSpeech(enable_redaction=False)
File "/usr/local/lib/python3.10/site-packages/tortoise/api_fast.py", line 215, in __init__
self.autoregressive.load_state_dict(torch.load(get_model_path('autoregressive.pth', models_dir)), strict=False)
File "/usr/local/lib/python3.10/site-packages/torch/serialization.py", line 1065, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.10/site-packages/torch/serialization.py", line 468, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.10/site-packages/torch/serialization.py", line 449, in __init__
super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/opt/ml/model/tortoise/models/models--Manmay--tortoise-tts/snapshots/50672670cecf2265aa61edb4eef5d1a293a8a373/autoregressive.pth'
my docker file is like below (I tried both default and custom model dir, but none works, if I use the default model dir, the error will be something like [No such file or directory: '/root/.cache/tortoise/...']):
FROM python:3.10
# Install system dependencies
RUN apt-get -y update && apt-get install -y --no-install-recommends \
wget \
git \
python3 \
nginx \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install pip using the official installer and upgrade pip
RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && \
python -m pip install --upgrade pip
# Set environment variables
ENV HF_HOME=/opt/ml/model/huggingface
ENV TORTOISE_MODELS_DIR=/opt/ml/model/tortoise/models
# Install tortoise-tts and additional Python packages
RUN python -m pip install flask gevent gunicorn tortoise-tts spacy && \
python -m spacy download en
COPY serverDir /opt/program
WORKDIR /opt/program
my predictor.py is like:
from fastapi import FastAPI, Request
from tortoise.api import TextToSpeech
import torch
import io
os.environ['TORTOISE_MODELS_DIR'] = '/opt/ml/model/tortoise/models'
# I used enable_redaction=False, otherwise it's going to raise hugging face model FileNotFoundError as well
tts_model = TextToSpeech(enable_redaction=False)
#... other code
Does anyone know if I'm setting up tortoise correctly(by just installing the package and call TextToSpeech())? Thanks in advance
The text was updated successfully, but these errors were encountered:
Also I tried to download and upload all the models from https://huggingface.co/Manmay/tortoise-tts/tree/main, but it seems that it requires 'autoregressive.ptt', instead of 'autoregressive.pth' as I saw in source code
I tried to start a tortoise server by writing a docker file installing tortoise and other dependencies, and a python script to run the server, but it always shows error:
my docker file is like below (I tried both default and custom model dir, but none works, if I use the default model dir, the error will be something like [No such file or directory: '/root/.cache/tortoise/...']):
my predictor.py is like:
Does anyone know if I'm setting up tortoise correctly(by just installing the package and call TextToSpeech())? Thanks in advance
The text was updated successfully, but these errors were encountered: