Merge branch 'main' into litellm_region_based_routing

This commit is contained in:
Krish Dholakia 2024-05-08 22:19:51 -07:00 committed by GitHub
commit 8ad979cdfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 793 additions and 448 deletions

View file

@ -1689,12 +1689,12 @@ def get_instance_fn(value: str, config_file_path: Optional[str] = None) -> Any:
module_file_path = os.path.join(directory, *module_name.split("."))
module_file_path += ".py"
spec = importlib.util.spec_from_file_location(module_name, module_file_path)
spec = importlib.util.spec_from_file_location(module_name, module_file_path) # type: ignore
if spec is None:
raise ImportError(
f"Could not find a module specification for {module_file_path}"
)
module = importlib.util.module_from_spec(spec)
module = importlib.util.module_from_spec(spec) # type: ignore
spec.loader.exec_module(module) # type: ignore
else:
# Dynamically import the module