MCPcopy
hub / github.com/huggingface/transformers / fill_result_with_error

Function fill_result_with_error

utils/create_dummy_models.py:1061–1074  ·  view source on GitHub ↗

Fill `result` with errors for all target model arch if we can't build processor

(result, error, trace, models_to_create)

Source from the content-addressed store, hash-verified

1059
1060
1061def fill_result_with_error(result, error, trace, models_to_create):
1062 """Fill `result` with errors for all target model arch if we can't build processor"""
1063 error = (error, trace)
1064 result["error"] = error
1065
1066 if "pytorch" in models_to_create:
1067 result["pytorch"] = {}
1068 for model_arch in models_to_create["pytorch"]:
1069 result["pytorch"][model_arch.__name__] = {"model": None, "checkpoint": None, "error": error}
1070
1071 # TODO: check what should we do with error/warning etc.
1072 # if we can't get any processor, we fill the report with the class name
1073 # otherwise, we could not build with these obtained processors, as we get the error
1074 # `error = f"No processor is returned by `convert_processors` for {config_class.__name__}."`
1075
1076
1077def upload_model(model_dir, organization, token):

Callers 1

buildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected