Merge pull request #727 from djm93dev/raise-exception
raise exception instead of print & exit
This commit is contained in:
commit
b1057afdf8
|
@ -37,8 +37,9 @@ def main():
|
||||||
case "GPT4All":
|
case "GPT4All":
|
||||||
llm = GPT4All(model=model_path, n_ctx=model_n_ctx, backend='gptj', n_batch=model_n_batch, callbacks=callbacks, verbose=False)
|
llm = GPT4All(model=model_path, n_ctx=model_n_ctx, backend='gptj', n_batch=model_n_batch, callbacks=callbacks, verbose=False)
|
||||||
case _default:
|
case _default:
|
||||||
print(f"Model {model_type} not supported!")
|
# raise exception if model_type is not supported
|
||||||
exit;
|
raise Exception(f"Model type {model_type} is not supported. Please choose one of the following: LlamaCpp, GPT4All")
|
||||||
|
|
||||||
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever, return_source_documents= not args.hide_source)
|
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever, return_source_documents= not args.hide_source)
|
||||||
# Interactive questions and answers
|
# Interactive questions and answers
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue