oobabooga / text-generation-webui

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

FormComponent in ui.py needs to be changed to IOComponent? #2780

Closed Wisdawn closed 1 year ago

Wisdawn commented 1 year ago

Describe the bug

It's an error message to be seen when trying to run text-generation-webui from the textgen conda environment:

Traceback (most recent call last):
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\server.py", line 35, in <module>
    from modules import chat, loaders, presets, shared, training, ui, utils
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\chat.py", line 18, in <module>
    from modules.text_generation import (generate_reply, get_encoded_length,
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\text_generation.py", line 17, in <module>
    from modules.models import clear_torch_cache, local_rank
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\models.py", line 17, in <module>
    from modules.models_settings import infer_loader
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\models_settings.py", line 6, in <module>
    from modules import shared, ui
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\ui.py", line 69, in <module>
    class ToolButton(gr.Button, gr.components.FormComponent):
AttributeError: module 'gradio.components' has no attribute 'FormComponent'. Did you mean: 'IOComponent'?

And when I manually made that change in ui.py, I didn't get that error message anymore and was able to run text-generation-webui just fine using this method. So, I treated this as confirmation that there's an issue here.

However, I don't have enough knowledge to confirm this, but perhaps this has to do with conda being linked to an older version of Python? Not sure, but wanted to bring this up in case it's relevant.

Is there an existing issue for this?

Reproduction

Not positive that this can be reproduced on every system, but on my end, I simply used the following command within a command prompt while in the oobabooga\oobabooga_windows\text-generation-webui> folder and the textgen conda environment:

python server.py --chat --extensions long_term_memory

Screenshot

No response

Logs

Traceback (most recent call last):
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\server.py", line 35, in <module>
    from modules import chat, loaders, presets, shared, training, ui, utils
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\chat.py", line 18, in <module>
    from modules.text_generation import (generate_reply, get_encoded_length,
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\text_generation.py", line 17, in <module>
    from modules.models import clear_torch_cache, local_rank
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\models.py", line 17, in <module>
    from modules.models_settings import infer_loader
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\models_settings.py", line 6, in <module>
    from modules import shared, ui
  File "C:\AI\oobabooga\oobabooga_windows\text-generation-webui\modules\ui.py", line 69, in <module>
    class ToolButton(gr.Button, gr.components.FormComponent):
AttributeError: module 'gradio.components' has no attribute 'FormComponent'. Did you mean: 'IOComponent'?

### System Info

```shell
Operating System: Windows 11 Pro 64-bit (10.0, Build 22621) (22621.ni_release.220506-1250)
Processor: AMD Ryzen 7 5800X 8-Core Processor (16 CPUs), ~3.8GHz
Memory: 32768MB RAM
Card name: NVIDIA GeForce RTX 2060
Dedicated Memory: 5968 MB
byrro commented 1 year ago

Same happening with me.

Changing line #69 in ui.py fixes:

Original:

class ToolButton(gr.Button, gr.components.FormComponent):

Fix:

class ToolButton(gr.Button, gr.components.IOComponent):

Machine I'm running:

System:
  Kernel: 5.19.0-1025-aws x86_64 bits: 64 compiler: N/A Console: pty pts/0
    Distro: Ubuntu 22.04.2 LTS (Jammy Jellyfish)
Machine:
  Type: Amazon System: Amazon EC2 product: g5.xlarge v: N/A serial: <superuser required>
  Mobo: Amazon EC2 model: N/A serial: <superuser required> BIOS: Amazon EC2 v: 1.0
    date: 10/16/2017
CPU:
  Info: dual core model: AMD EPYC 7R32 bits: 64 type: MT MCP arch: Zen 2 rev: 0 cache:
    L1: 128 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 2800 min/max: N/A cores: 1: 2800 2: 2800 3: 2800 4: 2800 bogomips: 22398
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3
Graphics:
  Device-1: Amazon.com driver: N/A bus-ID: 00:03.0
  Device-2: NVIDIA GA102GL [A10G] driver: N/A bus-ID: 00:1e.0
  Display: server: No display server data found. Headless machine? tty: 125x55
  Message: GL data unavailable in console. Try -G --display
Audio:
  Message: No device data found.
Network:
  Device-1: Amazon.com Elastic Network Adapter driver: ena v: kernel port: N/A bus-ID: 00:05.0
  IF: ens5 state: up speed: N/A duplex: N/A mac: <filter>
Drives:
  Local Storage: total: 332.83 GiB used: 22.24 GiB (6.7%)
  ID-1: /dev/nvme0n1 model: Amazon Elastic Block Store size: 100 GiB
  ID-2: /dev/nvme1n1 model: Amazon EC2 NVMe Instance Storage size: 232.83 GiB
Partition:
  ID-1: / size: 96.73 GiB used: 22.23 GiB (23.0%) fs: ext4 dev: /dev/nvme0n1p1
  ID-2: /boot/efi size: 104.4 MiB used: 6 MiB (5.8%) fs: vfat dev: /dev/nvme0n1p15
Swap:
  Alert: No swap data was found.
Sensors:
  Message: No sensor data found. Is lm-sensors configured?
Info:
  Processes: 116 Uptime: 56m Memory: 15.44 GiB used: 655.5 MiB (4.1%) Init: systemd runlevel: 5
  Compilers: gcc: 11.3.0 Packages: 718 Shell: Bash v: 5.1.16 inxi: 3.3.13
github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity for 30 days. If you believe it is still relevant, please leave a comment below.

Patrizi5 commented 9 months ago

(textgeneration) C:\Users\Patrick\text-generation-webui>python server.py Traceback (most recent call last): File "C:\Users\Patrick\text-generation-webui\server.py", line 4, in from modules import shared File "C:\Users\Patrick\text-generation-webui\modules\shared.py", line 10, in from modules.logging_colors import logger File "C:\Users\Patrick\text-generation-webui\modules\logging_colors.py", line 67, in setup_logging() File "C:\Users\Patrick\text-generation-webui\modules\logging_colors.py", line 30, in setup_logging from rich.console import Console ModuleNotFoundError: No module named 'rich'