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

"Unhandled exception: name '__file__' is not defined" #11

Closed
EtiennePerot opened this issue Sep 18, 2024 · 5 comments
Closed

"Unhandled exception: name '__file__' is not defined" #11

EtiennePerot opened this issue Sep 18, 2024 · 5 comments

Comments

@EtiennePerot
Copy link
Owner

Open WebUI commit open-webui/open-webui@cf86ba7 breaks this tool due to tools and functions no longer being written to files on disk. The tool and function re-execute themselves as subprocesses in order to function, by using Python's special __file__ global variable which is normally defined for modules when they are imported.

This manifests in Open WebUI as an error saying: Unhandled exception: name '__file__' is not defined.

@uzza1hossain
Copy link

Facing same issue.

@EtiennePerot
Copy link
Owner Author

Sorry about that. The fix needs to happen in Open WebUI first, not this tool. I have a fix for Open WebUI at EtiennePerot/open-webui@6477bf3 which I will send as a PR tomorrow and hope they accept it.

In the meantime, as a workaround, you can use an older version of Open WebUI; basically any version older than open-webui/open-webui@cf86ba7. For example, if you are using the Open WebUI container image, I've verified that ghcr.io/open-webui/open-webui:git-27109d2 is old enough to not have this problem.

@EtiennePerot
Copy link
Owner Author

A PR to fix this was sent to Open WebUI here: open-webui/open-webui#5511

@EtiennePerot
Copy link
Owner Author

This was merged and available in Open WebUI v0.3.22. However the tool has not been updated to work with it yet. Will post here when the fix is released.

@EtiennePerot
Copy link
Owner Author

EtiennePerot commented Sep 23, 2024

This issue is fixed as of release 0.6.0. It will work with Open WebUI v0.3.22, but is also backwards compatible to work with previous Open WebUI versions as well.

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

No branches or pull requests

2 participants