Skip to content

Commit 3876cb7

Browse files
VinciGit00f-aguzzi
andcommitted
feat: update exception
Co-Authored-By: Federico Aguzzi <[email protected]>
1 parent 3b5ee76 commit 3876cb7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scrapegraphai/graphs/abstract_graph.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ def _create_llm(self, llm_config: dict) -> object:
154154
try:
155155
self.model_token = models_tokens[llm_params["model_provider"]][llm_params["model"]]
156156
except KeyError:
157-
print(f"""Model {llm_params['model_provider']}/{llm_params['model']} not found,
157+
print(f"""Model {llm_params['model_provider']}/{llm_params['model']} not found,
158158
using default token size (8192)""")
159159
self.model_token = 8192
160160

161161
try:
162-
if llm_params["model_provider"] not in {"oneapi","nvidia","ernie","deepseek","togetherai"}:
162+
if llm_params["model_provider"] not in \
163+
{"oneapi","nvidia","ernie","deepseek","togetherai"}:
163164
if llm_params["model_provider"] == "bedrock":
164165
llm_params["model_kwargs"] = { "temperature" : llm_params.pop("temperature") }
165166
with warnings.catch_warnings():
@@ -195,7 +196,7 @@ def _create_llm(self, llm_config: dict) -> object:
195196
return ChatNVIDIA(**llm_params)
196197

197198
except Exception as e:
198-
print(f"Error instancing model: {e}")
199+
raise Exception(f"Error instancing model: {e}")
199200

200201

201202
def get_state(self, key=None) -> dict:

0 commit comments

Comments
 (0)