Zyin055 / Inspect-Embedding-Training

Python script to analyze textual inversion embedding files used with AI image generators
MIT License
102 stars 11 forks source link

A few updates I needed to make to get this running #23

Open ddrewpublic opened 10 months ago

ddrewpublic commented 10 months ago

Hi - I needed to make a few updates to this to get it running (which it did - thanks!)

Changes made:

Thanks!

Zyin055 commented 10 months ago

It looks like all the changes are for formatting and doesn't fix any bugs, correct?

I haven't used this code since the last update 10 months ago. I'm hesitant to accept a PR that doesn't fix a any bugs since I don't feel like testing these changes myself.

ddrewpublic commented 10 months ago

Hi - totally understandable!

There was one bug / sticking point that got me started :

23 - : GRAPH_IMAGE_SIZE: tuple[int, int] = (19, 9) # (X,Y) tuple in inches (multiply by 100 for (X,Y) pixel size for the output graphs)

25 + : (X,Y) tuple in inches (multiply by 100 for (X,Y) pixel size for the output graphs) 26 + : GRAPH_IMAGE_SIZE: Tuple[int, int] = (19, 9)

The lower case t meant that I was getting a TypeError: 'type' object is not subscriptable.

I'm not completely familiar with how python declares datatypes, but I have used the typing package

Once I imported that, there were a load more that needed updating.

Mostly dict to Dict, but also a missing type in line 417 -

The formatting is because I can't leave stuff alone!

Zyin055 commented 10 months ago

The typing issue is related to #6

If I recall correctly, it had something to do with Python changing how their typing worked in some version, don't recall if it was before or after v3.10 (the version that A1111 uses). But the script works fine with 3.10.

ddrewpublic commented 10 months ago

Ah - that could be it. I'm running 3.8.10 system wide, A1111 running in a docker instance that has 3.10.

Sorry!

frogbone1 commented 9 months ago

this sorted my issues with this script, thanks! no pytorch for python 3.12 yet, and was getting the "TypeError: 'type' object is not subscriptable" with a version before python 3.10. pull request clears it up, dropping a requirements.txt would also clear it up