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

Unable to open JSON #25

Open
Arjester0 opened this issue Apr 12, 2023 · 5 comments
Open

Unable to open JSON #25

Arjester0 opened this issue Apr 12, 2023 · 5 comments

Comments

@Arjester0
Copy link

Tried executing run command through powershell and gave me an error saying Unable to open JSON how do I fix this?

@weihan28
Copy link

weihan28 commented Apr 13, 2023

is your api key values at config.json missing double quotation marks?
Example:
**

# it should be
"keys": [
        {
            "EL_key":  "you key here",
            "OAI_key": "your key here"
        }
  ],
# instead of
"keys": [
        {
            "EL_key":  you key here,  # missing quotation marks right here
            "OAI_key": your key here
        }
  ],
``` **

@Arjester0
Copy link
Author

it is still not working even with the quotations

@weihan28
Copy link

weihan28 commented Apr 14, 2023

The easiest possibility to fix is an error in the json file,
So this is just to make sure that it is indeed not the issue present,

can you see any error messages under the json file?
error messages
(PS: this is if you are running it in an IDE like me, see the next comment i made on how to catch it in powershell.)

or if possible, you can post the file here
but please do make sure you remove the private keys or other sensitive data that might be present before posting.

@weihan28
Copy link

weihan28 commented Apr 14, 2023

Detecting these errors might be tricky, since it is in fact not an error code but a print message.

This is code from the run.py file

try:
        with open("config.json", "r") as json_file:
            data = json.load(json_file)
except:
        print("Unable to open JSON file.") # it just prints a statement without printing the error message
        exit()

If i modify this code,

try:
      with open("config.json", "r") as json_file:
          data = json.load(json_file)
except Exception as e:
      print(e)
      print("Unable to open JSON file.")
      exit()

it gives me

Invalid control character at: line 4 column 58 (char 83). # this is the real error code
Unable to open JSON file.

@weihan28
Copy link

weihan28 commented May 25, 2023

@Sylensar maybe this one might interest you. It already supports twitch chat. https://github.com/ardha27/AI-Waifu-Vtuber

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