oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
38.21k stars 5.07k forks source link

Whisper STT extensions does not work by the gradio/blocks.py #3815

Closed SnowMasaya closed 8 months ago

SnowMasaya commented 10 months ago

Describe the bug

I check the whisper stt on the docker container.

I refer the following instruction to make my environments

I check the whisper stt but it has the following error

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 1434, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 1335, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/audio.py", line 356, in postprocess
    file_path = self.make_temp_copy_if_needed(y)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/base.py", line 226, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/base.py", line 190, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

The following part is the root cause of this error

It works after I fix the code following like this

if prediction_value == "":
    prediction_value = None
else:
    prediction_value = block.postprocess(prediction_value)

Best

Is there an existing issue for this?

Reproduction

Prepare the Jetson

Jetson AGX Orin Developer Kit or Jetson Orin Nano Developer Kit.

Set up

Please the follow the instruction for setting up environments

Access the docker

Running container and set up env value

cd jetson-containers
./run.sh $(./autotag text-generation-webui)

exit container by the Ctrl + C

Run the container for set up environments for whisper

docker run --name text_generation_webui  --runtime nvidia -it --rm --network=host dustynv/text-generation-webui:r35.4.1 bash

Install library

apt-get update
apt-get install -y ffmpeg vim
cd /opt/text-generation-webui/extensions/whisper_stt
pip install -r requirements.txt

Run the text-generation-web-ui

cd /opt/text-generation-webui && python3 server.py   --model-dir=/data/models/text-generation-webui   --chat   --listen --extensions riva_asr

Whisper ASR work on the GUI

image

Screenshot

No response

Logs

I have the following error 

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 1434, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 1335, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/audio.py", line 356, in postprocess
    file_path = self.make_temp_copy_if_needed(y)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/base.py", line 226, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components/base.py", line 190, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

### System Info

```shell
Jetson AGX Orin Developer Kit

- https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/
github-actions[bot] commented 8 months ago

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

SodaPrettyCold commented 8 months ago

You saved my ass! I've been reinstalling all day trying to figure out what I'm doing wrong!