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

Syntax Error when running privateGPT.py #89

Closed
seeschweiler opened this issue May 13, 2023 · 5 comments
Closed

Syntax Error when running privateGPT.py #89

seeschweiler opened this issue May 13, 2023 · 5 comments

Comments

@seeschweiler
Copy link

Hi,

when running the script with

python privateGPT.py

I got the following syntax error:

File "privateGPT.py", line 26 match model_type: ^ SyntaxError: invalid syntax

Any suggestions?

Thanks!

@Mohit-Gaur
Copy link

Mohit-Gaur commented May 13, 2023

@seeschweiler How did you resolve this? I am facing the same error on Python 3.8

Edit: fixed by using Python 3.10

@hanwsf
Copy link

hanwsf commented May 13, 2023

if model_type == "LlamaCpp":
        llm = LlamaCpp(model_path=model_path, n_ctx=model_n_ctx, callbacks=callbacks, verbose=False)
elif model_type == "GPT4All":
        llm = GPT4All(model=model_path, n_ctx=model_n_ctx, backend='gptj', callbacks=callbacks, verbose=False)
else:
        print(f"Model {model_type} not supported!")
        exit;

revise to this will work.

@recursionbane
Copy link

Can we make @hanwsf's suggestion the default so that privateGPT will work with Python 3.8?

@ashishfeb13
Copy link

python privateGPT.py
File "privateGPT.py", line 34
match model_type:
^
SyntaxError: invalid syntax

any suggestions, please?

@glasafactor
Copy link

"match" will run only on Python 3.10 or above - the code is now newer than the installed Python. Alternative solution with upgrading Pylance (not tested)

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

6 participants