zydxt / sd-webui-rpg-diffusionmaster

Mastering Text-to-Image Diffusion: Recaptioning, Planning, and Generating with Multimodal LLMs (PRG)
GNU Affero General Public License v3.0
53 stars 2 forks source link

Install error regarding Azure Openai #11

Open Oninaig opened 4 months ago

Oninaig commented 4 months ago

Tried to install the extension today and I get this:

*** Error loading script: rpg_diffusionmaster.py
    Traceback (most recent call last):
      File "/home/matt/llm/stable-diffusion/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/home/matt/llm/stable-diffusion/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/home/matt/llm/stable-diffusion/stable-diffusion-webui/extensions/sd-webui-rpg-diffusionmaster/scripts/rpg_diffusionmaster.py", line 2, in <module>
        from rpg_lib.llm_agents import llm_factory
      File "/home/matt/llm/stable-diffusion/stable-diffusion-webui/extensions/sd-webui-rpg-diffusionmaster/rpg_lib/llm_agents.py", line 4, in <module>
        from openai import AzureOpenAI, OpenAI
    ImportError: cannot import name 'AzureOpenAI' from 'openai' (/home/matt/llm/stable-diffusion/stable-diffusion-webui/venv/lib/python3.10/site-packages/openai/__init__.py)

According to a quick search I can run openai migrate but even doing that didn't remove the error.

pynooblin commented 3 months ago

same error: *** Error loading script: rpg_diffusionmaster.py Traceback (most recent call last): File "/root/autodl-tmp/stable-diffusion-webui/modules/scripts.py", line 527, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/root/autodl-tmp/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/root/autodl-tmp/stable-diffusion-webui/extensions/sd-webui-rpg-diffusionmaster/scripts/rpg_diffusionmaster.py", line 2, in from rpg_lib.llm_agents import llm_factory File "/root/autodl-tmp/stable-diffusion-webui/extensions/sd-webui-rpg-diffusionmaster/rpg_lib/llm_agents.py", line 4, in from openai import AzureOpenAI, OpenAI ImportError: cannot import name 'AzureOpenAI' from 'openai' (/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/openai/init.py)

pynooblin commented 3 months ago

sd-webui-regional-prompter already updated to the latestest version

zydxt commented 2 months ago

can you check the openai version? Try to upgrade the openai to 1.10.0 in your virtual venv