mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
Fix Dockerfile.hpu ffmpeg package install, update README.md whisper container usage
This commit is contained in:
parent
9e3936581a
commit
82a5380ad7
@ -22,9 +22,17 @@ RUN apt-get update && apt-get install -y \
|
||||
bc \
|
||||
gawk \
|
||||
tmux \
|
||||
ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download and install the static build of ffmpeg
|
||||
RUN mkdir -p /usr/local/bin/ffmpeg && \
|
||||
cd /usr/local/bin/ffmpeg && \
|
||||
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && \
|
||||
tar -xf ffmpeg-release-amd64-static.tar.xz && \
|
||||
cp -a ffmpeg-*-static/ffmpeg /usr/bin/ffmpeg && \
|
||||
cp -a ffmpeg-*-static/ffprobe /usr/bin/ffprobe && \
|
||||
rm -rf /usr/local/bin/ffmpeg
|
||||
|
||||
# Add Whisper repo contents
|
||||
ADD . /root/whisper
|
||||
WORKDIR /root/whisper
|
||||
|
||||
17
README.md
17
README.md
@ -160,7 +160,7 @@ docker run -it --runtime=habana \
|
||||
--cap-add=sys_nice \
|
||||
--net=host \
|
||||
--ipc=host \
|
||||
-v /path/to/your/whisper:/workspace/whisper \
|
||||
-v /path/to/your/whisper:/root/whisper \
|
||||
whisper_hpu:latest \
|
||||
/bin/bash
|
||||
```
|
||||
@ -171,7 +171,20 @@ Make sure to replace `/path/to/your/whisper` with the path to the Whisper reposi
|
||||
|
||||
To run the `whisper` command with Intel® Gaudi® hpu, you can use the `--device hpu` option:
|
||||
|
||||
whisper audio.flac audio.mp3 audio.wav --model turbo --device hpu
|
||||
python3 -m whisper.transcribe audio.flac audio.mp3 audio.wav --model turbo --device hpu
|
||||
|
||||
|
||||
### Python usage with Intel® Gaudi® hpu
|
||||
|
||||
To use Intel® Gaudi® hpu within Python, you can specify the device when loading the model:
|
||||
|
||||
```python
|
||||
import whisper
|
||||
|
||||
model = whisper.load_model("turbo", device="hpu")
|
||||
result = model.transcribe("audio.mp3")
|
||||
print(result["text"])
|
||||
```
|
||||
|
||||
## More examples
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user