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

Error message, no content in GUI, and crashes on Windows 10 #28

Open
Shibbyz opened this issue Aug 5, 2024 · 3 comments
Open

Error message, no content in GUI, and crashes on Windows 10 #28

Shibbyz opened this issue Aug 5, 2024 · 3 comments

Comments

@Shibbyz
Copy link

Shibbyz commented Aug 5, 2024

Describe the bug
I get the error message: "Error Detected: Please Restart Miles" in the top left corner of the GUI (see screenshot) every time I launch it. There is no other content appearing in the GUI (according to the screenshots there should be a chat conversation in the GUI). The PowerShell (admin) window on the other hand does show the python output, including the chat conversation.

I believe it is prudent to mention that something may have gone awry during the installation because following the Run sequence as layed out under the installation instructions doesn't work since the 'Scripts' folder ended up in the 'Miles-env' folder, and NOT in the 'Miles-V2' folder. I have been starting Miles by navigating to the folder where the Scripts are and activating the virtual environment there and then navigating to the path specified in the instructions and starting it from there.
P.S. I have no idea if that is relevant or not to the issues I'm experiencing as I'm not proficient in this stuff.

_Open PowerShell as Admin

Navigate to Project Directory:

cd C:\Miles-env\M.I.L.E.S\Miles-V2

Activate Virtual Environment:

.\Scripts\Activate

Start Project with npm:

npm start_

I have also encountered the following python error (this was the second "crash" I encountered after having Miles installed for only an hour or so):

Python Output: Listening for prompt... Speak now.

Python Output: User:
Python Error: Traceback (most recent call last):
File "C:\Miles-env\M.I.L.E.S\Miles-V2\main.py", line 1198, in

Python Error: main()
File "C:\Miles-env\M.I.L.E.S\Miles-V2\main.py", line 1154, in main

Python Error: _, skip_wake_word = reply(query) # reply now returns a tuple

Python Error: ^^^^^^^^^^^^
File "C:\Miles-env\M.I.L.E.S\Miles-V2\main.py", line 889, in reply

Python Error: response_content = ask(question)

Python Error: ^^^^^^^^^^^^^
File "C:\Miles-env\M.I.L.E.S\Miles-V2\main.py", line 783, in ask

Python Error: print("User:", question)
File "C:\Users\GTSA - Infinity\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode

Python Error: return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^
Python Error: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u0131' in position 15: character maps to

Python script exited with code: 1

Screenshots
2024-08-06 00_59_32-Window

Desktop (please complete the following information):

  • OS: Windows 10

Is there any way I can fix this? I really love the idea behind Miles and really want it to work.

@small-cactus
Copy link
Owner

Seems that Miles or the speech recognition accidentally provided a character that cannot be processed in python.

To fix this, delete the file named conversation_history.txt.

Then go ahead and try to start Miles. Let me know if this fixes the issue.

@Shibbyz
Copy link
Author

Shibbyz commented Aug 6, 2024

It did not solve the problem. The GUI is still behaving the same way and Miles again crashed or stopped working after I asked it to play something on Spotify/or change the volume.

This is what it looks like when I start Miles.
2024-08-06 03_03_47-Window

This is what it looked like before it crashed.
2024-08-06 03_10_14-Window

@small-cactus
Copy link
Owner

The spotify error might be related to Spotify's own servers for their API being down, Miles does not have the capacity to request changes that it is not allowed to use, they are simply not available.

That spotify error happens when you try to request a change from a part in Spotify's API that you are not permitted to use or have not asked for permission to use. Given that the app does not request any changes outside of what I ask permission for it is unlikely that this is an issue on my part, at least for spotify issues.

The GUI not responding because of that warning that appears shouldn't happen, but there is no way for me to prevent it, so you can edit the following lines to fix the issue inside renderer.js, keep in mind that any errors will no longer appear on the GUI, and instead will only be in the terminal window:

BEFORE:

function processMessage(message, isError) {
    if (isError) {
        setStatus(message, 'status-error', 'fas fa-exclamation-triangle');
        return;
    }
    // Check if an error has been detected previously
    if (isErrorDetected) {
        console.log("Blocking message due to prior error.");
        return; // Exit early
    }
    let messageClass = '';
    
    // Detect and wrap LaTeX with spans for MathJax processing
    message = message.replace(/\\\(.*?\\\)/g, function(match) {
        return `<span class="mathjax-latex">${match}</span>`;
    });

AFTER:

function processMessage(message, isError) {
    if (isError) {
        setStatus(message, 'status-error', 'fas fa-exclamation-triangle');
        return;
    }
    // Comment out or remove these lines
    // if (isErrorDetected) {
    //     console.log("Blocking message due to prior error.");
    //     return; // Exit early
    // }
    let messageClass = '';
    
    // Detect and wrap LaTeX with spans for MathJax processing
    message = message.replace(/\\\(.*?\\\)/g, function(match) {
        return `<span class="mathjax-latex">${match}</span>`;
    });

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