-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
README: added Docker build and run instructions #109
README: added Docker build and run instructions #109
Conversation
rudolfolah
commented
Jun 14, 2023
- build the image with a tag name
- run the image, downloading voice files into container and copying output to host
* build the image with a tag name * run the image, downloading voice files into container and copying output to host
Thanks! This worked for me on a non-M1 mac. The only issue for me is that the |
Awesome 😎
I wonder if using an absolute path would work or using |
Worked for me on an M1 mac! And similarly,
|
Also quick question, does this mean piper can only be called by spinning up a docker image and running these commands? Is there a way to get piper into my path so that I can call it from anywhere? I'm trying to get this repo working on my M1 mac: https://github.com/yacineMTB/talk |
echo 'Welcome to the world of speech synthesis!' | \ | ||
./piper --model en-us-lessac-medium.onnx --output_file welcome.wav | ||
|
||
# while the container is running, and in a different terminal, copy the output file to the host | ||
docker cp $(docker ps -lq):/dist/piper/welcome.wav . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on the comments suggesting that the --output_file
and --output_dir
command line arguments are not working as expected (could be working and putting it in the wrong path?), here's a possible workaround for the current directory:
echo 'Welcome to the world of speech synthesis!' | \ | |
./piper --model en-us-lessac-medium.onnx --output_file welcome.wav | |
# while the container is running, and in a different terminal, copy the output file to the host | |
docker cp $(docker ps -lq):/dist/piper/welcome.wav . | |
echo 'Welcome to the world of speech synthesis!' | \ | |
./piper --model en-us-lessac-medium.onnx | |
# while the container is running, and in a different terminal, copy the output files to the host | |
docker exec $(docker ps -lq)bash -c "ls /dist/piper/*.wav" | while read line; do docker cp $(docker ps -lq):/$line .; done |
based on this StackOverflow answer, I have not tested this yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept running into errors with this along the lines of:
However I was able to get a quick bash script that accomplishes copying all of the files over:
#!/bin/bash
# Get the ID of the most recently created Docker container
container_id=$(docker ps -lq)
# Execute a command in the Docker container to get the list of .wav files
files=$(docker exec -it $container_id bash -c "cd /dist/piper && ls *.wav")
# Remove any carriage return characters (in case this script is run on Windows)
files=${files//$'\r'/}
# Loop over each file
for file in $files; do
# Copy the file from the Docker container to the current directory
docker cp "$container_id:/dist/piper/$file" .
done
*script generated by GPT-4, works on my machine but someone should probably verify this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that script works; on Windows I had to run bash
first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweet
here's an alternative way of running piper in Docker where the output directory is mounted:
Output dir and the mounted volume worked for me on Windows: |
Works great for me, thanks!. I just had to add the missing |
I'm cloning the repo and am getting this when running the docker build what am I missing docker buildx build --target build -t piper:latest .
|