Skip to content
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

init.py file added and file structed is edited #4

Merged
merged 1 commit into from
Jul 15, 2023
Merged

init.py file added and file structed is edited #4

merged 1 commit into from
Jul 15, 2023

Conversation

idiotcommerce
Copy link

@idiotcommerce idiotcommerce commented Jul 15, 2023

@picobyte
@toriato
tagger folder has to be in tagger.py file location. and in tagger folder init.py file missed so i added

please check it

@picobyte
Copy link
Owner

picobyte commented Jul 15, 2023

I seem to get an error:

*** Error loading script: tagger.py
    Traceback (most recent call last):
      File "stable-diffusion-webui/modules/scripts.py", line 274, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "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 "stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/scripts/tagger.py", line 4, in <module>
        from tagger.api import on_app_started
    ModuleNotFoundError: No module named 'tagger'

This is due to the lines:

from tagger.api import on_app_started
from tagger.ui import on_ui_tabs

these should now be:

from scripts.tagger.api import on_app_started
from scripts.tagger.ui import on_ui_tabs

there are some more.
fixed after

 rg -l 'from tagger' | xargs -d "\n" -r sed -i 's/from tagger/from scripts.tagger/'

solved some more issues, but it is merged, thanks.

@picobyte picobyte merged commit c52fa20 into picobyte:master Jul 15, 2023
@idiotcommerce
Copy link
Author

i will work on that. thank for merged. if i can able to do any i will do.

@picobyte
Copy link
Owner

It is fixed, we all make mistakes, I do as well, but please try to run the extension with the changes to catch issues like this.

@idiotcommerce
Copy link
Author

i have some doubts. can you please mention that. so that i can able to try more.
in my modules.py file i have content only this

def show(a):
print(a)
def size(a):
print(len(a))

while accessing i am getting error. see it

(fastapienv) F:\gitcontrib\stable-diffusion-webui-wd14-tagger>C:/Users/hp/Documents/fastapi/fastapienv/Scripts/python.exe f:/gitcontrib/stable-diffusion-webui-wd14-tagger/scripts/tagger.py
Traceback (most recent call last):
File "f:\gitcontrib\stable-diffusion-webui-wd14-tagger\scripts\tagger.py", line 3, in
from modules import script_callbacks
ImportError: cannot import name 'script_callbacks' from 'modules' (C:\Users\hp\Documents\fastapi\fastapienv\Lib\site-packages\modules.py)

there is no function or class or anything like script_callbacks. but i am trying to access it so there is a problem with that. so please check.

if you have anything better in the modules.py file, please send here. i will take and try.

@idiotcommerce
Copy link
Author

if you are working on this one thing brother. i saw one of your error

@picobyte

image

**### in that image you have modules folder. but if you check the github folder. there is no module folder. all the problem comes from there i think. please check it.

thank you**

@picobyte
Copy link
Owner

picobyte commented Jul 16, 2023

Sorry, I missed your comments yesterday. There was an issue with the requirements.txt I initially added. I ran to create the requirements.txt

pipreqs --force `pwd`
sed -i s/==.*$//g requirements.txt

but it ended up adding a few external modules that were shadowing webui modules. If you have installed those, due to the initial requirements, you should again remove them. change to the directory of my extension and

pip uninstall webui
pip uninstall modules
pip uninstall launch

In particular installing a module named modules was a serious problem. I don't understand why python did not flag that name as illegal. Sorry for the inconvenience.

@picobyte
Copy link
Owner

I think I'm going to revert this commit, or apply it at a later stage. What is the purpose? This movement of code makes it tough to merge any other code from other branches.

@idiotcommerce
Copy link
Author

ok i will check these and try. thank you

@idiotcommerce
Copy link
Author

please read this comment. it can be helpful
civitai/sd_civitai_extension#23

@idiotcommerce
Copy link
Author

idiotcommerce commented Jul 17, 2023

i checked so many and i will send chatgpt link. please look those. it may be useful. mine is asking c++ 14+ version so i tried but it failed after installation. so still i am getting same error. so i am sending this link. this may be useful for you please check those two links and work on that. it can solve some of your problem
https://chat.openai.com/share/92b7a453-70c1-4136-a3f4-bbaca159d34c

https://stackoverflow.com/questions/64291491/how-to-solve-preparing-wheel-metadata-error-this-error-for-macos-for-pytho

PLEASE CHECK THESE TWO LINKS.

don't forget to run the command of 2ed link related to git. copy and past on environment. it may or may not be work. but for me it is some what worked. please check

https://stackoverflow.com/questions/71009659/message-note-this-error-originates-from-a-subprocess-and-is-likely-not-a-prob

this is also checked latter. it may be helpful for the problem

thank you

@picobyte
Copy link
Owner

Ok I will have a look, thanks. Also I may reapply this later, as I said. It was just very difficult to merge this one, in the end I resolved it manually. I also like to apply this, and then there is no reason anymore to fix the paths again as you proposed.

@picobyte
Copy link
Owner

please read this comment. it can be helpful civitai/sd_civitai_extension#23

launch is no longer in requirements,

@picobyte
Copy link
Owner

I'm not sure.. what are you trying to solve here..?

@idiotcommerce
Copy link
Author

i want to solve so many errors. but i am unable to load the modules so i just stopped. and took another git project

@picobyte
Copy link
Owner

picobyte commented Jul 17, 2023

For me this extension runs without issues. What OS are you running this on, it may be easier to run in a virtual environment. venv or micromamba. Also if you have an issue it is better to create one because the messages below a closed pull request I only sometimes visit, I get no notifications of this.

@idiotcommerce
Copy link
Author

i am using windows 10. i am trying to work on any project, the main problem for me is the error you are getting is not in my computer, before i came to your level error, i have to face lot errors like different things, i am new to github so, dependancies are the big problems. i both are getting same error, i will try my best. but i am not even close to your error point. so much time is wasting. menas not used for solving errors. so if you can able to give any suggessions i am very much accept your suggessions

@picobyte
Copy link
Owner

sounds complex. Do you have ssh access to the server where you install it? In windows there is putty to ssh to a server. Then, if you run it in the console on the remote server the errors may become more clear.

@picobyte
Copy link
Owner

picobyte commented Jul 17, 2023

I don't think it is the best option to ask chatgpt for answers. The suggestions may be right sometimes, but sometimes, in particular if 'unsure' it just dreams up very nonsensical things, and then the solutions it hands may do more harm than good. In my opinion the way to solve things is
1 pipoint the exact error
2 query the web using strong keywords that exactly describe this error
then you usually end up on a forum where others had the same issue, and you can resolve it.

@picobyte
Copy link
Owner

picobyte commented Jul 17, 2023

Do you have a recent checkout of my extension? I did fix something for fastapi, or at least I think I fixed it. See here

@idiotcommerce
Copy link
Author

thank you for suggestions. i will learn from that. i checked the extension. it is nice. i know FASTAPI. i build carzone project on that.
when i get errors,
if i run uvicorn main:app --reload it will take to the projects on local directory. and run in the web browser

127.0.0.1:8000/docs here all endpoints are available. so i check each individually if any particualr endpoint got error, i will try to work on that. like 500 server not found error or 422 error, like that.

most of them are mainly comes from attributes misplaced. that is the problem main in fast Api. i solved around 3 and are merged. because i am new so i tried. then i want to do on the python. python is big stream so i will try atleast one big quality thing, then it will improve my knowledge.

again thank you for suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants