We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
GaNDLF is not running on macOS
**Describe the bug**
Currently, we are requiring `torch==1.8.2`:
https://github.com/CBICA/GaNDLF/blob/e8f922266ec7af1c3fac36439290d22a5e63866d/setup.py#L56
Which is not supported by PyTorch on macOS[[ref](https://pytorch.org/get-started/locally/)].

**To Reproduce**
Steps to reproduce the behavior: https://cbica.github.io/GaNDLF/setup

**Expected behavior**
The only reason for us to drop support of an OS should be if something major is breaking.

**Screenshots**
N.A.

**GaNDLF Version**
<!-- Put the output of the following command:
python -c 'import GANDLF as g;print(g.__version__)'
-->
0.0.14-dev

**Desktop (please complete the following information):**
 - OS: macOS
 - Version: N.A.

**Additional context**
Reported by @Sofia-Mouchtaris 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 """The setup script."""
4 
5 
6 import os
7 from setuptools import setup, find_packages
8 from setuptools.command.install import install
9 from setuptools.command.develop import develop
10 from setuptools.command.egg_info import egg_info
11 
12 with open("README.md") as readme_file:
13     readme = readme_file.read()
14 
15 
16 def git_submodule_update():
17     ## submodule update
18     os.system("git submodule update --init --recursive")
19 
20 
21 class CustomInstallCommand(install):
22     def run(self):
23         install.run(self)
24         git_submodule_update()
25 
26 
27 class CustomDevelopCommand(develop):
28     def run(self):
29         develop.run(self)
30         git_submodule_update()
31 
32 
33 class CustomEggInfoCommand(egg_info):
34     def run(self):
35         egg_info.run(self)
36         git_submodule_update()
37 
38 
39 # read version.py
40 import sys, re
41 
42 try:
43     filepath = "GANDLF/version.py"
44     version_file = open(filepath)
45     (__version__,) = re.findall('__version__ = "(.*)"', version_file.read())
46 
47 except Exception as error:
48     __version__ = "0.0.1"
49     sys.stderr.write("Warning: Could not open '%s' due %s\n" % (filepath, error))
50 
51 requirements = [
52     "black",
53     "numpy==1.21.0",
54     "scipy",
55     "SimpleITK!=2.0.*",
56     "torch==1.8.2",
57     "torchvision",
58     "tqdm",
59     "torchio==0.18.57",
60     "pandas",
61     "pylint",
62     "scikit-learn>=0.23.2",
63     "pickle5>=0.0.11",
64     "setuptools",
65     "seaborn",
66     "pyyaml",
67     "tiffslide",
68     "scikit-image",
69     "matplotlib",
70     "requests>=2.25.0",
71     "pyvips",
72     "pytest",
73     "coverage",
74     "pytest-cov",
75     "psutil",
76     "medcam",
77     "opencv-python",
78     "torchmetrics",
79     "OpenPatchMiner==0.1.6",
80     "zarr==2.10.3",
81     "pydicom",
82     "onnx",
83 ]
84 
85 setup(
86     name="GANDLF",
87     version=__version__,
88     author="Jose Agraz, Vinayak Ahluwalia, Bhakti Baheti, Spyridon Bakas, Ujjwal Baid, Megh Bhalerao, Brandon Edwards, Karol Gotkowski, Caleb Grenko, Orhun Güley, Ibrahim Ethem Hamamci, Sarthak Pati, Micah Sheller, Juliia Skobleva, Siddhesh Thakur, Spiros Thermos",  # alphabetical order
89     author_email="software@cbica.upenn.edu",
90     python_requires=">=3.7",
91     packages=find_packages(),
92     cmdclass={  # this ensures git_submodule_update is called during install
93         "install": CustomInstallCommand,
94         "develop": CustomDevelopCommand,
95         "egg_info": CustomEggInfoCommand,
96     },
97     scripts=[
98         "gandlf_run",
99         "gandlf_constructCSV",
100         "gandlf_collectStats",
101         "gandlf_patchMiner",
102         "gandlf_preprocess",
103         "gandlf_anonymizer",
104         "gandlf_verifyInstall",
105     ],
106     classifiers=[
107         "Development Status :: 3 - Alpha",
108         "Intended Audience :: Science/Research",
109         "License :: OSI Approved :: BSD License",
110         "Natural Language :: English",
111         "Operating System :: OS Independent",
112         "Programming Language :: Python :: 3.7",
113         "Programming Language :: Python :: 3.8",
114         "Programming Language :: Python :: 3.9",
115         "Topic :: Scientific/Engineering :: Medical Science Apps",
116     ],
117     description=(
118         "PyTorch-based framework that handles segmentation/regression/classification using various DL architectures for medical imaging."
119     ),
120     install_requires=requirements,
121     license="BSD-3-Clause License",
122     long_description=readme,
123     long_description_content_type="text/markdown",
124     include_package_data=True,
125     keywords="semantic, segmentation, regression, classification, data-augmentation, medical-imaging",
126     zip_safe=False,
127 )
128 
129 ## windows vips installation
130 if os.name == "nt":  # proceed for windows
131     from pathlib import Path
132 
133     # download and extract if main dll is absent
134     if not Path("./vips/vips-dev-8.10/bin/libvips-42.dll").exists():
135         print("Downloading and extracting VIPS for Windows")
136         url = "https://github.com/libvips/libvips/releases/download/v8.10.2/vips-dev-w64-all-8.10.2.zip"
137         zip_to_extract = "./vips.zip"
138         import urllib.request, zipfile
139 
140         urllib.request.urlretrieve(url, zip_to_extract)
141         z = zipfile.ZipFile(zip_to_extract)
142         z.extractall("./vips")
143         z.close()
144         os.remove(zip_to_extract)
145
```
--- 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -53,7 +53,6 @@
     "numpy==1.21.0",
     "scipy",
     "SimpleITK!=2.0.*",
-    "torch==1.8.2",
     "torchvision",
     "tqdm",
     "torchio==0.18.57",
@@ -82,6 +81,12 @@
     "onnx",
 ]
 
+# pytorch doesn't have LTS support on OSX - https://github.com/CBICA/GaNDLF/issues/389
+if sys.platform == "darwin":
+    requirements.append("torch==1.9.0")
+else:
+    requirements.append("torch==1.8.2")
+
 setup(
     name="GANDLF",
     version=__version__,

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -53,7 +53,6 @@\n     \"numpy==1.21.0\",\n     \"scipy\",\n     \"SimpleITK!=2.0.*\",\n-    \"torch==1.8.2\",\n     \"torchvision\",\n     \"tqdm\",\n     \"torchio==0.18.57\",\n@@ -82,6 +81,12 @@\n     \"onnx\",\n ]\n \n+# pytorch doesn't have LTS support on OSX - https://github.com/CBICA/GaNDLF/issues/389\n+if sys.platform == \"darwin\":\n+    requirements.append(\"torch==1.9.0\")\n+else:\n+    requirements.append(\"torch==1.8.2\")\n+\n setup(\n     name=\"GANDLF\",\n     version=__version__,\n", "issue": "GaNDLF is not running on macOS\n**Describe the bug**\r\nCurrently, we are requiring `torch==1.8.2`:\r\nhttps://github.com/CBICA/GaNDLF/blob/e8f922266ec7af1c3fac36439290d22a5e63866d/setup.py#L56\r\nWhich is not supported by PyTorch on macOS[[ref](https://pytorch.org/get-started/locally/)].\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior: https://cbica.github.io/GaNDLF/setup\r\n\r\n**Expected behavior**\r\nThe only reason for us to drop support of an OS should be if something major is breaking.\r\n\r\n**Screenshots**\r\nN.A.\r\n\r\n**GaNDLF Version**\r\n<!-- Put the output of the following command:\r\npython -c 'import GANDLF as g;print(g.__version__)'\r\n-->\r\n0.0.14-dev\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: macOS\r\n - Version: N.A.\r\n\r\n**Additional context**\r\nReported by @Sofia-Mouchtaris \r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\n\"\"\"The setup script.\"\"\"\n\n\nimport os\nfrom setuptools import setup, find_packages\nfrom setuptools.command.install import install\nfrom setuptools.command.develop import develop\nfrom setuptools.command.egg_info import egg_info\n\nwith open(\"README.md\") as readme_file:\n    readme = readme_file.read()\n\n\ndef git_submodule_update():\n    ## submodule update\n    os.system(\"git submodule update --init --recursive\")\n\n\nclass CustomInstallCommand(install):\n    def run(self):\n        install.run(self)\n        git_submodule_update()\n\n\nclass CustomDevelopCommand(develop):\n    def run(self):\n        develop.run(self)\n        git_submodule_update()\n\n\nclass CustomEggInfoCommand(egg_info):\n    def run(self):\n        egg_info.run(self)\n        git_submodule_update()\n\n\n# read version.py\nimport sys, re\n\ntry:\n    filepath = \"GANDLF/version.py\"\n    version_file = open(filepath)\n    (__version__,) = re.findall('__version__ = \"(.*)\"', version_file.read())\n\nexcept Exception as error:\n    __version__ = \"0.0.1\"\n    sys.stderr.write(\"Warning: Could not open '%s' due %s\\n\" % (filepath, error))\n\nrequirements = [\n    \"black\",\n    \"numpy==1.21.0\",\n    \"scipy\",\n    \"SimpleITK!=2.0.*\",\n    \"torch==1.8.2\",\n    \"torchvision\",\n    \"tqdm\",\n    \"torchio==0.18.57\",\n    \"pandas\",\n    \"pylint\",\n    \"scikit-learn>=0.23.2\",\n    \"pickle5>=0.0.11\",\n    \"setuptools\",\n    \"seaborn\",\n    \"pyyaml\",\n    \"tiffslide\",\n    \"scikit-image\",\n    \"matplotlib\",\n    \"requests>=2.25.0\",\n    \"pyvips\",\n    \"pytest\",\n    \"coverage\",\n    \"pytest-cov\",\n    \"psutil\",\n    \"medcam\",\n    \"opencv-python\",\n    \"torchmetrics\",\n    \"OpenPatchMiner==0.1.6\",\n    \"zarr==2.10.3\",\n    \"pydicom\",\n    \"onnx\",\n]\n\nsetup(\n    name=\"GANDLF\",\n    version=__version__,\n    author=\"Jose Agraz, Vinayak Ahluwalia, Bhakti Baheti, Spyridon Bakas, Ujjwal Baid, Megh Bhalerao, Brandon Edwards, Karol Gotkowski, Caleb Grenko, Orhun G\u00fcley, Ibrahim Ethem Hamamci, Sarthak Pati, Micah Sheller, Juliia Skobleva, Siddhesh Thakur, Spiros Thermos\",  # alphabetical order\n    author_email=\"software@cbica.upenn.edu\",\n    python_requires=\">=3.7\",\n    packages=find_packages(),\n    cmdclass={  # this ensures git_submodule_update is called during install\n        \"install\": CustomInstallCommand,\n        \"develop\": CustomDevelopCommand,\n        \"egg_info\": CustomEggInfoCommand,\n    },\n    scripts=[\n        \"gandlf_run\",\n        \"gandlf_constructCSV\",\n        \"gandlf_collectStats\",\n        \"gandlf_patchMiner\",\n        \"gandlf_preprocess\",\n        \"gandlf_anonymizer\",\n        \"gandlf_verifyInstall\",\n    ],\n    classifiers=[\n        \"Development Status :: 3 - Alpha\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: BSD License\",\n        \"Natural Language :: English\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Topic :: Scientific/Engineering :: Medical Science Apps\",\n    ],\n    description=(\n        \"PyTorch-based framework that handles segmentation/regression/classification using various DL architectures for medical imaging.\"\n    ),\n    install_requires=requirements,\n    license=\"BSD-3-Clause License\",\n    long_description=readme,\n    long_description_content_type=\"text/markdown\",\n    include_package_data=True,\n    keywords=\"semantic, segmentation, regression, classification, data-augmentation, medical-imaging\",\n    zip_safe=False,\n)\n\n## windows vips installation\nif os.name == \"nt\":  # proceed for windows\n    from pathlib import Path\n\n    # download and extract if main dll is absent\n    if not Path(\"./vips/vips-dev-8.10/bin/libvips-42.dll\").exists():\n        print(\"Downloading and extracting VIPS for Windows\")\n        url = \"https://github.com/libvips/libvips/releases/download/v8.10.2/vips-dev-w64-all-8.10.2.zip\"\n        zip_to_extract = \"./vips.zip\"\n        import urllib.request, zipfile\n\n        urllib.request.urlretrieve(url, zip_to_extract)\n        z = zipfile.ZipFile(zip_to_extract)\n        z.extractall(\"./vips\")\n        z.close()\n        os.remove(zip_to_extract)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n\"\"\"The setup script.\"\"\"\n\n\nimport os\nfrom setuptools import setup, find_packages\nfrom setuptools.command.install import install\nfrom setuptools.command.develop import develop\nfrom setuptools.command.egg_info import egg_info\n\nwith open(\"README.md\") as readme_file:\n    readme = readme_file.read()\n\n\ndef git_submodule_update():\n    ## submodule update\n    os.system(\"git submodule update --init --recursive\")\n\n\nclass CustomInstallCommand(install):\n    def run(self):\n        install.run(self)\n        git_submodule_update()\n\n\nclass CustomDevelopCommand(develop):\n    def run(self):\n        develop.run(self)\n        git_submodule_update()\n\n\nclass CustomEggInfoCommand(egg_info):\n    def run(self):\n        egg_info.run(self)\n        git_submodule_update()\n\n\n# read version.py\nimport sys, re\n\ntry:\n    filepath = \"GANDLF/version.py\"\n    version_file = open(filepath)\n    (__version__,) = re.findall('__version__ = \"(.*)\"', version_file.read())\n\nexcept Exception as error:\n    __version__ = \"0.0.1\"\n    sys.stderr.write(\"Warning: Could not open '%s' due %s\\n\" % (filepath, error))\n\nrequirements = [\n    \"black\",\n    \"numpy==1.21.0\",\n    \"scipy\",\n    \"SimpleITK!=2.0.*\",\n    \"torchvision\",\n    \"tqdm\",\n    \"torchio==0.18.57\",\n    \"pandas\",\n    \"pylint\",\n    \"scikit-learn>=0.23.2\",\n    \"pickle5>=0.0.11\",\n    \"setuptools\",\n    \"seaborn\",\n    \"pyyaml\",\n    \"tiffslide\",\n    \"scikit-image\",\n    \"matplotlib\",\n    \"requests>=2.25.0\",\n    \"pyvips\",\n    \"pytest\",\n    \"coverage\",\n    \"pytest-cov\",\n    \"psutil\",\n    \"medcam\",\n    \"opencv-python\",\n    \"torchmetrics\",\n    \"OpenPatchMiner==0.1.6\",\n    \"zarr==2.10.3\",\n    \"pydicom\",\n    \"onnx\",\n]\n\n# pytorch doesn't have LTS support on OSX - https://github.com/CBICA/GaNDLF/issues/389\nif sys.platform == \"darwin\":\n    requirements.append(\"torch==1.9.0\")\nelse:\n    requirements.append(\"torch==1.8.2\")\n\nsetup(\n    name=\"GANDLF\",\n    version=__version__,\n    author=\"Jose Agraz, Vinayak Ahluwalia, Bhakti Baheti, Spyridon Bakas, Ujjwal Baid, Megh Bhalerao, Brandon Edwards, Karol Gotkowski, Caleb Grenko, Orhun G\u00fcley, Ibrahim Ethem Hamamci, Sarthak Pati, Micah Sheller, Juliia Skobleva, Siddhesh Thakur, Spiros Thermos\",  # alphabetical order\n    author_email=\"software@cbica.upenn.edu\",\n    python_requires=\">=3.7\",\n    packages=find_packages(),\n    cmdclass={  # this ensures git_submodule_update is called during install\n        \"install\": CustomInstallCommand,\n        \"develop\": CustomDevelopCommand,\n        \"egg_info\": CustomEggInfoCommand,\n    },\n    scripts=[\n        \"gandlf_run\",\n        \"gandlf_constructCSV\",\n        \"gandlf_collectStats\",\n        \"gandlf_patchMiner\",\n        \"gandlf_preprocess\",\n        \"gandlf_anonymizer\",\n        \"gandlf_verifyInstall\",\n    ],\n    classifiers=[\n        \"Development Status :: 3 - Alpha\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: BSD License\",\n        \"Natural Language :: English\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Topic :: Scientific/Engineering :: Medical Science Apps\",\n    ],\n    description=(\n        \"PyTorch-based framework that handles segmentation/regression/classification using various DL architectures for medical imaging.\"\n    ),\n    install_requires=requirements,\n    license=\"BSD-3-Clause License\",\n    long_description=readme,\n    long_description_content_type=\"text/markdown\",\n    include_package_data=True,\n    keywords=\"semantic, segmentation, regression, classification, data-augmentation, medical-imaging\",\n    zip_safe=False,\n)\n\n## windows vips installation\nif os.name == \"nt\":  # proceed for windows\n    from pathlib import Path\n\n    # download and extract if main dll is absent\n    if not Path(\"./vips/vips-dev-8.10/bin/libvips-42.dll\").exists():\n        print(\"Downloading and extracting VIPS for Windows\")\n        url = \"https://github.com/libvips/libvips/releases/download/v8.10.2/vips-dev-w64-all-8.10.2.zip\"\n        zip_to_extract = \"./vips.zip\"\n        import urllib.request, zipfile\n\n        urllib.request.urlretrieve(url, zip_to_extract)\n        z = zipfile.ZipFile(zip_to_extract)\n        z.extractall(\"./vips\")\n        z.close()\n        os.remove(zip_to_extract)\n", "path": "setup.py"}]}