Skip to content

Commit

Permalink
Enable passing custom parameters for custom model
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiping Kang committed Dec 10, 2024
1 parent 2d998f6 commit 1999734
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion jac-mtllm/mtllm/aott.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ def aott_raise(
if not (contains_media and not is_custom)
else meaning_typed_input_list
)
return model(meaning_typed_input, media=media, **model_params) # type: ignore
if is_custom:
try:
# This is a temporary solution to enable passing in custom parameters to custom models
# custom model should override the __call__ method to accept function_inputs parameter
return model(meaning_typed_input, media=media, function_inputs=inputs_information, **model_params) # type: ignore
except TypeError as e:
# this is for backward compatibility, for any existing custom models that do not have the function_inputs parameter
return model(meaning_typed_input, media=media, **model_params) # type: ignore
else:
return model(meaning_typed_input, media=media, **model_params) # type: ignore


def execute_react(
Expand Down

0 comments on commit 1999734

Please sign in to comment.