private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

Syntax error model type

Open Joaov41 opened this issue 1 year ago • 8 comments

Running macOS Ventura getting this error match model_type: ^ SyntaxError: invalid syntax

Joaov41 avatar Jun 04 '23 19:06 Joaov41

Ah I just ran it and had the same error. macOS Ventura as well

tehruhn avatar Jun 04 '23 19:06 tehruhn

Downgrading to python 3.10.1 now get a different error

from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'

Joaov41 avatar Jun 04 '23 20:06 Joaov41

Downgrading to python 3.10.1 now get a different error

from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'

use 'python -m pip install python-dotenv'

ProxyAyush avatar Jun 04 '23 20:06 ProxyAyush

Running macOS Ventura getting this error match model_type: ^ SyntaxError: invalid syntax

you must use python 3.11 or newer versions, your python version must be older

ProxyAyush avatar Jun 04 '23 20:06 ProxyAyush

Running macOS Ventura getting this error match model_type: ^ SyntaxError: invalid syntax

you must use python 3.11 or newer versions, your python version must be older

Just upgraded to 3.11.1 and now the error is other. No module langchain

Joaov41 avatar Jun 04 '23 21:06 Joaov41

Running macOS Ventura getting this error match model_type: ^ SyntaxError: invalid syntax

you must use python 3.11 or newer versions, your python version must be older

Just upgraded to 3.11.1 and now the error is other. No module langchain

then use python -m pip install langchain exactly and paste it in terminal

ProxyAyush avatar Jun 05 '23 00:06 ProxyAyush

I got the same Error but was able to go around it. The match model_type is simply a switch statement which is looking for your model type. By commenting out the match statement and just writing the code for the specific model you use, the error can be bypassed.

When using the default model:

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

llm = GPT4All(model=model_path, n_ctx=model_n_ctx, backend='gptj', callbacks=callbacks, verbose=False)

CooleMuetze avatar Jun 08 '23 15:06 CooleMuetze

Running macOS Ventura getting this error match model_type: ^ SyntaxError: invalid syntax

you must use python 3.11 or newer versions, your python version must be older

I am using 3.11.2 and I get this error.

alexfilothodoros avatar Jun 12 '23 07:06 alexfilothodoros