prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add kwargs to EfficientDet model() method
  Add kwargs to EfficientDet model() method. This will allow to pass `pretrained_backbone` argument to EfficientDet `create_model_from_config()` method. That will prevent loading pretrained weights if the user wish to do so
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `icevision/models/ross/efficientdet/model.py`
  Content:
  ```
  1 __all__ = ["model"]
  2 
  3 from icevision.imports import *
  4 from icevision.utils import *
  5 from icevision.models.ross.efficientdet.utils import *
  6 from icevision.models.ross.efficientdet.backbones import *
  7 from effdet import get_efficientdet_config, EfficientDet, DetBenchTrain, unwrap_bench
  8 from effdet import create_model_from_config
  9 from effdet.efficientdet import HeadNet
  10 
  11 
  12 def model(
  13     backbone: EfficientDetBackboneConfig,
  14     num_classes: int,
  15     img_size: int,
  16 ) -> nn.Module:
  17     """Creates the efficientdet model specified by `model_name`.
  18 
  19     The model implementation is by Ross Wightman, original repo
  20     [here](https://github.com/rwightman/efficientdet-pytorch).
  21 
  22     # Arguments
  23         backbone: Specifies the backbone to use create the model. For pretrained models, check
  24             [this](https://github.com/rwightman/efficientdet-pytorch#models) table.
  25         num_classes: Number of classes of your dataset (including background).
  26         img_size: Image size that will be fed to the model. Must be squared and
  27             divisible by 128.
  28 
  29     # Returns
  30         A PyTorch model.
  31     """
  32     model_name = backbone.model_name
  33     config = get_efficientdet_config(model_name=model_name)
  34     config.image_size = (img_size, img_size) if isinstance(img_size, int) else img_size
  35 
  36     model_bench = create_model_from_config(
  37         config,
  38         bench_task="train",
  39         bench_labeler=True,
  40         num_classes=num_classes - 1,
  41         pretrained=backbone.pretrained,
  42     )
  43 
  44     # TODO: Break down param groups for backbone
  45     def param_groups_fn(model: nn.Module) -> List[List[nn.Parameter]]:
  46         unwrapped = unwrap_bench(model)
  47 
  48         layers = [
  49             unwrapped.backbone,
  50             unwrapped.fpn,
  51             nn.Sequential(unwrapped.class_net, unwrapped.box_net),
  52         ]
  53         param_groups = [list(layer.parameters()) for layer in layers]
  54         check_all_model_params_in_groups2(model, param_groups)
  55 
  56         return param_groups
  57 
  58     model_bench.param_groups = MethodType(param_groups_fn, model_bench)
  59 
  60     return model_bench
  61
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/icevision/models/ross/efficientdet/model.py b/icevision/models/ross/efficientdet/model.py
  --- a/icevision/models/ross/efficientdet/model.py
  +++ b/icevision/models/ross/efficientdet/model.py
  @@ -13,6 +13,7 @@
       backbone: EfficientDetBackboneConfig,
       num_classes: int,
       img_size: int,
  +    **kwargs,
   ) -> nn.Module:
       """Creates the efficientdet model specified by `model_name`.
   
  @@ -39,6 +40,7 @@
           bench_labeler=True,
           num_classes=num_classes - 1,
           pretrained=backbone.pretrained,
  +        **kwargs,
       )
   
       # TODO: Break down param groups for backbone
  
verification_info: {"golden_diff": "diff --git a/icevision/models/ross/efficientdet/model.py b/icevision/models/ross/efficientdet/model.py\n--- a/icevision/models/ross/efficientdet/model.py\n+++ b/icevision/models/ross/efficientdet/model.py\n@@ -13,6 +13,7 @@\n     backbone: EfficientDetBackboneConfig,\n     num_classes: int,\n     img_size: int,\n+    **kwargs,\n ) -> nn.Module:\n     \"\"\"Creates the efficientdet model specified by `model_name`.\n \n@@ -39,6 +40,7 @@\n         bench_labeler=True,\n         num_classes=num_classes - 1,\n         pretrained=backbone.pretrained,\n+        **kwargs,\n     )\n \n     # TODO: Break down param groups for backbone\n", "issue": "Add kwargs to EfficientDet model() method\nAdd kwargs to EfficientDet model() method. This will allow to pass `pretrained_backbone` argument to EfficientDet `create_model_from_config()` method. That will prevent loading pretrained weights if the user wish to do so\n", "before_files": [{"content": "__all__ = [\"model\"]\n\nfrom icevision.imports import *\nfrom icevision.utils import *\nfrom icevision.models.ross.efficientdet.utils import *\nfrom icevision.models.ross.efficientdet.backbones import *\nfrom effdet import get_efficientdet_config, EfficientDet, DetBenchTrain, unwrap_bench\nfrom effdet import create_model_from_config\nfrom effdet.efficientdet import HeadNet\n\n\ndef model(\n    backbone: EfficientDetBackboneConfig,\n    num_classes: int,\n    img_size: int,\n) -> nn.Module:\n    \"\"\"Creates the efficientdet model specified by `model_name`.\n\n    The model implementation is by Ross Wightman, original repo\n    [here](https://github.com/rwightman/efficientdet-pytorch).\n\n    # Arguments\n        backbone: Specifies the backbone to use create the model. For pretrained models, check\n            [this](https://github.com/rwightman/efficientdet-pytorch#models) table.\n        num_classes: Number of classes of your dataset (including background).\n        img_size: Image size that will be fed to the model. Must be squared and\n            divisible by 128.\n\n    # Returns\n        A PyTorch model.\n    \"\"\"\n    model_name = backbone.model_name\n    config = get_efficientdet_config(model_name=model_name)\n    config.image_size = (img_size, img_size) if isinstance(img_size, int) else img_size\n\n    model_bench = create_model_from_config(\n        config,\n        bench_task=\"train\",\n        bench_labeler=True,\n        num_classes=num_classes - 1,\n        pretrained=backbone.pretrained,\n    )\n\n    # TODO: Break down param groups for backbone\n    def param_groups_fn(model: nn.Module) -> List[List[nn.Parameter]]:\n        unwrapped = unwrap_bench(model)\n\n        layers = [\n            unwrapped.backbone,\n            unwrapped.fpn,\n            nn.Sequential(unwrapped.class_net, unwrapped.box_net),\n        ]\n        param_groups = [list(layer.parameters()) for layer in layers]\n        check_all_model_params_in_groups2(model, param_groups)\n\n        return param_groups\n\n    model_bench.param_groups = MethodType(param_groups_fn, model_bench)\n\n    return model_bench\n", "path": "icevision/models/ross/efficientdet/model.py"}], "after_files": [{"content": "__all__ = [\"model\"]\n\nfrom icevision.imports import *\nfrom icevision.utils import *\nfrom icevision.models.ross.efficientdet.utils import *\nfrom icevision.models.ross.efficientdet.backbones import *\nfrom effdet import get_efficientdet_config, EfficientDet, DetBenchTrain, unwrap_bench\nfrom effdet import create_model_from_config\nfrom effdet.efficientdet import HeadNet\n\n\ndef model(\n    backbone: EfficientDetBackboneConfig,\n    num_classes: int,\n    img_size: int,\n    **kwargs,\n) -> nn.Module:\n    \"\"\"Creates the efficientdet model specified by `model_name`.\n\n    The model implementation is by Ross Wightman, original repo\n    [here](https://github.com/rwightman/efficientdet-pytorch).\n\n    # Arguments\n        backbone: Specifies the backbone to use create the model. For pretrained models, check\n            [this](https://github.com/rwightman/efficientdet-pytorch#models) table.\n        num_classes: Number of classes of your dataset (including background).\n        img_size: Image size that will be fed to the model. Must be squared and\n            divisible by 128.\n\n    # Returns\n        A PyTorch model.\n    \"\"\"\n    model_name = backbone.model_name\n    config = get_efficientdet_config(model_name=model_name)\n    config.image_size = (img_size, img_size) if isinstance(img_size, int) else img_size\n\n    model_bench = create_model_from_config(\n        config,\n        bench_task=\"train\",\n        bench_labeler=True,\n        num_classes=num_classes - 1,\n        pretrained=backbone.pretrained,\n        **kwargs,\n    )\n\n    # TODO: Break down param groups for backbone\n    def param_groups_fn(model: nn.Module) -> List[List[nn.Parameter]]:\n        unwrapped = unwrap_bench(model)\n\n        layers = [\n            unwrapped.backbone,\n            unwrapped.fpn,\n            nn.Sequential(unwrapped.class_net, unwrapped.box_net),\n        ]\n        param_groups = [list(layer.parameters()) for layer in layers]\n        check_all_model_params_in_groups2(model, param_groups)\n\n        return param_groups\n\n    model_bench.param_groups = MethodType(param_groups_fn, model_bench)\n\n    return model_bench\n", "path": "icevision/models/ross/efficientdet/model.py"}]}