ParisNeo/lollms-webui

No graphical interface appears

rabotone opened this issue ยท 28 comments

(LoLLMS-webui) G:\lollms-webui-main>python app.py
Configuration file is very old. Replacing with default configuration
Added entries : [], removed entries:[]
******************* Building Binding from main Process *************************
Loading binding None install ON
Couldn't build binding.
unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
******************* Building mounted Personalities from main Process *************************
english/generic/lollms
Loading from C:\ProgramData\Anaconda3\envs\gpt4all-webui\lib\site-packages\lollms\personalities_zoo\english\generic\lollms
************ Personalities mounted (Main process) ***************************
Checking discussions database...
Please open your browser and go to http://localhost:9600 to view the ui
debug mode:false
******************* Building Binding from generation Process *************************
Loading binding None install ON
Traceback (most recent call last):
File "G:\lollms-webui-main\api_init_.py", line 222, in rebuild_model
self.binding = self.load_binding(self.config["binding_name"], install=True)
File "G:\lollms-webui-main\api_init
.py", line 141, in load_binding
binding_path = self.lollms_paths.bindings_zoo_path/binding_name
TypeError: unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
Couldn't build binding
unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
******************* Building mounted Personalities from generation Process *************************
english/generic/lollms
************ Personalities mounted (Generation process) ***************************
Personality set successfully
Launching config verification thread
Launching cancel verification thread
Launching clear verification thread
No model loaded. Waiting for new configuration instructions
Listening on :http://localhost:9600

Hi, let me test and I'll answer you

Ok. I tryed to do an installation and it worked. I think I have seen this problem in other people's setup.
Do you have an antivirus? Some of them are so dump that they block any javascript that is compressed. And our vue.js frontend is actually compressed javascript as we build it.

You can try to use the dev mode if you already have node.js installed on your pc. Just go to web folder and install dependencies :

npm install

Then run the server:

npm run dev

Now use the link that you receive to open the front end.

Ok. I tryed to do an installation and it worked. I think I have seen this problem in other people's setup. Do you have an antivirus? Some of them are so dump that they block any javascript that is compressed. And our vue.js frontend is actually compressed javascript as we build it.

You can try to use the dev mode if you already have node.js installed on your pc. Just go to web folder and install dependencies :

npm install

Then run the server:

npm run dev

Now use the link that you receive to open the front end.

1686463933399
how to resolve it

Hey!

I have the exact same problem as the OP has, this with the last version of lollms-webui (which is my first version, I just discovered your tool), under Windows 10 Entreprise x64 21H2, and Avast antivirus with disabled agents.

If you use npm run. Make sure you have also launched the backend python app.py

The npm run will only run the front end and it needs the backend to be running

Well, ain't the batch supposed to do everything required, as mentioned in the "Easy Install" part of the readme?

Here's the relevant part of my log :

Launching application...
Configuration file is very old. Replacing with default configuration
Added entries : [], removed entries:[]
******************* Building Binding from main Process *************************
Loading binding None install ON
Couldn't build binding.
unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
******************* Building mounted Personalities from main Process *************************
english/generic/lollms
Loading from C:\Windows\System32\lollms-webui\env\Lib\site-packages\lollms\personalities_zoo\english\generic\lollms
************ Personalities mounted (Main process) ***************************
Checking discussions database...
Please open your browser and go to http://localhost:9600 to view the ui
debug mode:false
******************* Building Binding from generation Process *************************
Loading binding None install ON
Traceback (most recent call last):
File "C:\Windows\System32\lollms-webui\api_init_.py", line 222, in rebuild_model
self.binding = self.load_binding(self.config["binding_name"], install=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Windows\System32\lollms-webui\api_init
.py", line 141, in load_binding
binding_path = self.lollms_paths.bindings_zoo_path/binding_name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
Couldn't build binding
unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'
******************* Building mounted Personalities from generation Process *************************
english/generic/lollms
************ Personalities mounted (Generation process) ***************************
Personality set successfully
Launching config verification thread
Launching cancel verification thread
Launching clear verification thread
No model loaded. Waiting for new configuration instructions
Listening on :http://localhost:9600

It's weird that I find an environment into my C:\Windows\System32 folder. And those bindings which can't be created. Is there a problem of "" and "/" maybe (Windows uses \ and linux / if I remember correctly) ?

I'm sorry, I'm a noob ! ^^

A1yks commented

same problem

I had a similar issue with windows. The browser was complaining of an unexpected MIME type. Fixed in Regedit it by changing Computer\HKEY_CLASSES_ROOT.js content type in to application/javascript.

Hi and sorry for being late, I was very buzzy lately.

Normally for most people and browsers, this works out of the box. Juts run webui.bat or now we also have c_webui.bat if you want to use conda instead of venv, things work. But some browser configurations are giving me nightmares. For example, some of them doesn't like that I have compressed javascript and they just assume it is harmful or whatever.

This ui is made using vue.js, and compiled to become a static interface. And the compiler just compresses the javascript to gain space, which makes it difficult to read. I have tested this on multiple PCs with different configurations and i never had those errors so it is really difficult for me to fix this for every one.

It is a personal project (not a corporation or a company or anything like that). Just me wanting to do something cool to have fun with. And when you use a fun project you are expected to be a little hacky and accept to play around and try to make it work and when it does, you can share your knowledge with people who want to do this. And that's how we can move forward.

I can't be everywhere all the time. I have a day job and can only work at night or weekends and prefer spending more time on building new features rather than fixing very specific bugs for each individual.

I don't want to sound harsh, but yeah, it is not a professional project. Maybe if people want to help me build it it can get better. For now I'm basically coding alone with some other guy who helps only on the frontend. And beleive me, this project is huge, if you factor in lollms and lollms-webui with the 260 personalities and 9 bindings built in three months at nights (some days I worked up to 4am), you should expect bugs.

I appreciate any help on the testing and figuring out how to fix things front.

This project is 100% free. I'm not gaining money out of it, my youtube channel is not monitized, nor do I offer subscriptions or pation.

I do this for fun and for others who want to test this new technology. I hope at one point it will be stable anough for people to start appreciating it.

FYI, it's a CORS issue with the webserver being used. It plagues nearly all default of the npm web server. I don't know what the fix is in code, I'm not a npm guy, but you can try changing your browser address to 127.0.0.1:9600 instead of localhost. Maybe this will be enough hint to the devs to find the culprit. CORS/XSS rules basically prevent accessing a code-asset (i.e. vue.js) from one domain (localhost) to another domain (127.0.0.1). I had this trick work for me on a similarly-configured stable-diffusion project's web-ui.

Hi @Terristen and thank you for the reply.
I actually explicitely implement CORD policy to allow access from some domains. You can look at the Flask server creation where I do enable that:

app = Flask("GPT4All-WebUI", static_url_path="/static", static_folder="static")
socketio = SocketIO(app,  cors_allowed_origins="*", async_mode='gevent', ping_timeout=1200, ping_interval=4000)

I'll think about this if I get the time

I have similar issue and editing Regedit solved it, thank you @edcredegas! Still waiting for the official patch though, editing Regedit is probably dangerous and shouldn't be necessary.

I solved this issue:
I posted it as another issues because I'm not used to incrementing other people repos:

#343

Basically:
Add

import mimetypes
mimetypes.add_type('application/javascript', '.js')
mimetypes.add_type('text/css', '.css')

to line 57 of app.py (before flask import)

I tried to change app.py by adding the mimetypes, but didnt worked for me.
My regedit entry for .js was text, so maybe this (properly changed by me in last years some day) is the reason, usually its linked to application/javascript.
I created a .reg file so you can just install it by using it. Unfortunally another "smart" function does not allow to upload a reg file here. So you have to rename the file and remove .txt.

Then you can install it. It runs then in firefox. But still not in opera for me (windows 10 or 11 i dont know).

jsFix.reg.txt

hi, did it work since?

I tried to change app.py by adding the mimetypes, but didnt worked for me. My regedit entry for .js was text, so maybe this (properly changed by me in last years some day) is the reason, usually its linked to application/javascript. I created a .reg file so you can just install it by using it. Unfortunally another "smart" function does not allow to upload a reg file here. So you have to rename the file and remove .txt.

Then you can install it. It runs then in firefox. But still not in opera for me (windows 10 or 11 i dont know).

jsFix.reg.txt

I had the mime type error in my browser and I had to edit registry. lollms-webui pulls the content-type from the registry and that was text. This fixed my issue. Maybe it should be done by the installer?

I faced this issue with the system browser (Edge). None of the fixes suggested above worked. Tried (more or less in this order):

  • npm install / npm run -- there are no scripts in package.json any more
  • opening in firefox (same blank page)
  • registry edit
  • opening 127.0.0.1:9600 instead of localhost

Then I opened in Chrome instead of Edge, went to localhost:9600 and the page opened successfully. I don't know if it was the registry edit that did it or if it would have worked in Chrome if I'd opened it first.

I faced this issue with the system browser (Edge). None of the fixes suggested above worked. Tried (more or less in this order):

  • npm install / npm run -- there are no scripts in package.json any more
  • opening in firefox (same blank page)
  • registry edit
  • opening 127.0.0.1:9600 instead of localhost

Then I opened in Chrome instead of Edge, went to localhost:9600 and the page opened successfully. I don't know if it was the registry edit that did it or if it would have worked in Chrome if I'd opened it first.

The page gets hard cached so you wouldn't notice even if it was fixed. I had to disable cache in network tab of developer tools (f12)

Please reset the cache in order to get the latest version of the webui. I have upgraded the pydantic typing on all endpoints and so some of the endpoint calls of the old webui are no more compatible.

Pydentic helps me protect the server side from sql injections and other injection stuff.

I just did a fresh install, and I'm having this error. Is there a setting in my browser I can change to get it to work? Or has anyone found any solutions?

What is the backend showing? do you see some errors?

This is the output:
C:\Users\me\Desktop\LoLLMs\installer_files\lollms_env\Lib\site-packages\pydantic_internal_fields.py:151: UserWarning: Field "model_name" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
INFO: Started server process [20332]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:9600 (Press CTRL+C to quit)
INFO: ::1:60061 - "GET / HTTP/1.1" 200 OK
INFO: ::1:60061 - "GET /assets/index-c19a73f0.js HTTP/1.1" 200 OK
INFO: ::1:60062 - "GET /assets/index-8e397dc7.css HTTP/1.1" 200 OK

This is the output in the developer tools in the webpage:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

When I tried reloading the page, I got this output, don't know if it's useful at all:
INFO: ::1:60145 - "GET / HTTP/1.1" 304 Not Modified

Actually, during installation, I have noticed a few times that it says "The syntax of the command is incorrect". Maybe something is also going wrong during installation?

I just tried the registry edit, and it fixed the problem. Will this have an effect on anything else I use my computer for?

I don't think so

am getting the same error

Field "model_name" has conflict with protected namespace

how did you get around it?

Hi, that is a simple warning. i'll fix it some time when I heal. As I am a little ill those days.