Update the module config with the override_config_kwargs. Args: module_config: The module config from Huggingface Transformers. override_config_kwargs: The kwargs to override the module config.
(module_config, override_config_kwargs)
| 59 | |
| 60 | |
| 61 | def update_model_config(module_config, override_config_kwargs): |
| 62 | """Update the module config with the override_config_kwargs. |
| 63 | Args: |
| 64 | module_config: The module config from Huggingface Transformers. |
| 65 | override_config_kwargs: The kwargs to override the module config. |
| 66 | """ |
| 67 | for key, val in override_config_kwargs.items(): |
| 68 | if isinstance(val, dict): |
| 69 | update_model_config(getattr(module_config, key), val) |
| 70 | else: |
| 71 | setattr(module_config, key, val) |
| 72 | |
| 73 | |
| 74 | def get_huggingface_actor_config(model_name: str, override_config_kwargs=None, trust_remote_code=False) -> dict: |
no outgoing calls