mlx-chat / mlx-chat-app

Chat with MLX is a high-performance macOS application that connects your local documents to a personalized large language model (LLM).
MIT License
161 stars 9 forks source link

Error: Electron Frozen (Frozen Runpy) #35

Open USMCM1A1 opened 6 months ago

USMCM1A1 commented 6 months ago

electron-app@0.1.0 dev cross-env NODE_ENV=development concurrently -k "cross-env BROWSER=none npm run next:dev" "npm run electron:dev"

[1] [1] > electron-app@0.1.0 electron:dev [1] > npm run build:main && wait-on tcp:3000 && electron . [1] [0] [0] > electron-app@0.1.0 next:dev [0] > next dev [0] [1] [1] > electron-app@0.1.0 build:main [1] > tsc -p main && npm run build:tailwindMain [1] [0] - ready started server on 0.0.0.0:3000, url: http://localhost:3000 [0] Attention: Next.js now collects completely anonymous telemetry regarding usage. [0] This information is used to shape Next.js' roadmap and prioritize features. [0] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [0] https://nextjs.org/telemetry [0] [1] [1] > electron-app@0.1.0 build:tailwindMain [1] > npx tailwindcss build --config tailwind.config.main.js -o ./main/tailwind.css [1] [1] Browserslist: caniuse-lite is outdated. Please run: [1] npx update-browserslist-db@latest [1] Why you should do it regularly: https://github.com/browserslist/update-db#readme [1] [1] Rebuilding... [1] [1] Done in 170ms. [1] 2024-03-09 22:06:51.376 Electron[11803:1006036] NSWindow does not support nonactivating panel styleMask 0x80 [1] 2024-03-09 22:06:51.377 Electron[11803:1006036] NSWindow does not support nonactivating panel styleMask 0x80 [1] 2024-03-09 22:06:51.490 Electron[11803:1006036] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES. [0] - event compiled client and server successfully in 1587 ms (306 modules) [0] - wait compiling... [0] - wait compiling /page (client and server)... [0] Browserslist: caniuse-lite is outdated. Please run: [0] npx update-browserslist-db@latest [0] Why you should do it regularly: https://github.com/browserslist/update-db#readme [0] - event compiled client and server successfully in 2.2s (689 modules) [0] - wait compiling... [0] - event compiled successfully in 180 ms (378 modules) [1] APP: Starting server for model: mistralai/Mistral-7B-Instruct-v0.2 on port: 8080 [1] Server error: Traceback (most recent call last): [1] File "", line 189, in _run_module_as_main [1] File "", line 112, in _get_module_details [1] File "/Users/williammarcellino/mlx-chat-app/server/init.py", line 1, in [1] from .utils import generate, load, convert [1] [1] Server error: File "/Users/williammarcellino/mlx-chat-app/server/utils.py", line 165 [1] f"repetition_penalty must be a non-negative float, got { [1] ^ [1] SyntaxError: unterminated string literal (detected at line 165) [1] [1] Server process exited with code 1

namp commented 6 months ago

Easiest way to fix this it to upgrade to python 3.12.

Two other alternatives are either to get rid of the new line within the f-string or to use triple ''' to enclose the string. However you'll need to make such changes at many lines and at different files

stockeh commented 6 months ago

@namp I appreciate you following up on this! I may have jumped ahead with Python versions (3.12) in development.

I'm thinking this could be a greater issue to allow for backwards compatibility with older Python versions.

vitorcalvi commented 4 months ago

first of all, Amazing project, i was looking for it! Some issues won't able to run

[1] 2024-05-26 08:28:33.922 Electron[36435:2335087] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES. [0] - event compiled client and server successfully in 117 ms (306 modules)

[0] (node:36346) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. [0] (Use node --trace-warnings ... to show where the warning was created) [0] - event compiled client and server successfully in 617 ms (676 modules)

1] Server output: Error: type object 'QuantizedLinear' has no attribute 'quantize_module' [1] [1] Server error: 127.0.0.1 - - [26/May/2024 08:28:39] "POST /api/init HTTP/1.1" 500 -