Skip to content

Commit

Permalink
Merge branch 'hot-fixes' into Knowledge_Extraction_Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MobinNesari81 authored Jul 9, 2024
2 parents 21e353e + 942e35c commit 3f18cb9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 39 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/notebook-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@ jobs:

runs-on: ubuntu-latest
steps:

- name: Free up disk space
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -48,6 +63,7 @@ jobs:
- name: Install dependencies
if: "!contains(env.COMMIT_MESSAGE, 'skip ci') && contains(env.COMMIT_MESSAGE, 'ci:execute')"
run: |
sudo apt-get update && sudo apt install xvfb -y
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
pip install jupyter_client==7.3.5 # downgrade jupyter-client to fix hangs
Expand Down
35 changes: 15 additions & 20 deletions projects/NaturalLanguageProcessing/sentiment_analysis.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions projects/Neuroscience/blurry_vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
" Building wheel for torch-intermediate-layer-getter (setup.py) ... \u001b[?25l\u001b[?25hdone\n"
" Building wheel for torch-intermediate-layer-getter (setup.py) ... \u001B[?25l\u001B[?25hdone\n"
]
}
],
Expand Down Expand Up @@ -1877,7 +1877,7 @@
"# # Download the Data\n",
"# if \"cats-and-dogs.zip\" not in os.listdir():\n",
"# !wget --no-check-certificate \\\n",
"# \"https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_3367a.zip\" \\\n",
"# \"https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_5340.zip\" \\\n",
"# -O \"cats-and-dogs.zip\"\n",
"\n",
"# local_zip = 'cats-and-dogs.zip'\n",
Expand Down
9 changes: 6 additions & 3 deletions projects/Neuroscience/cellular_segmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@
"labels_train = np.zeros((len(masks_train), 2,\n",
" masks_train.shape[-2],\n",
" masks_train.shape[-1]),\n",
" np.long)\n",
" np.longlong)\n",
"labels_train[:, 0] = masks_train == 0\n",
"labels_train[:, 1] = masks_train > 0\n",
"\n",
"labels_test = np.zeros((len(masks_test), 2,\n",
" masks_test.shape[-2],\n",
" masks_test.shape[-1]),\n",
" np.long)\n",
" np.longlong)\n",
"labels_test[:, 0] = masks_test == 0\n",
"labels_test[:, 1] = masks_test > 0"
]
Expand Down Expand Up @@ -831,12 +831,15 @@
" for ibatch in np.arange(0, n_train, batch_size):\n",
" # augment the data\n",
" inds = np.arange(ibatch, min(n_train, ibatch+batch_size))\n",
" train_data = train_data.astype(np.float32)\n",
" train_labels = train_labels.astype(np.float32)\n",
" imgs, lbls, _ = random_rotate_and_resize(train_data[inds],\n",
" train_labels[inds])\n",
"\n",
" # transfer to torch + GPU\n",
" imgs = torch.from_numpy(imgs).to(device=device)\n",
" lbls = torch.from_numpy(lbls).to(device=device)\n",
" lbls = lbls.long()\n",
"\n",
" # compute the loss\n",
" y = net(imgs)\n",
Expand Down Expand Up @@ -1379,7 +1382,7 @@
"from tifffile import imread\n",
"\n",
"fname = \"gt1.tif\"\n",
"url = \"https://www.suite2p.org/test_data/gt1.tif\"\n",
"url = \"https://www.suite2p.org/test_data/gt1.tif\" # This URL does not exist.\n",
"\n",
"if not os.path.isfile(fname):\n",
" try:\n",
Expand Down
26 changes: 13 additions & 13 deletions projects/ReinforcementLearning/human_rl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.25.1 which is incompatible.\u001b[0m\u001b[31m\n",
"\u001b[0m\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"chex 0.1.81 requires numpy>=1.25.0, but you have numpy 1.23.3 which is incompatible.\u001b[0m\u001b[31m\n",
"\u001b[0m"
"\u001B[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.25.1 which is incompatible.\u001B[0m\u001B[31m\n",
"\u001B[0m\u001B[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"chex 0.1.81 requires numpy>=1.25.0, but you have numpy 1.23.3 which is incompatible.\u001B[0m\u001B[31m\n",
"\u001B[0m"
]
}
],
"source": [
"# @title Install dependencies\n",
"!pip install jedi --quiet\n",
"!pip install --upgrade pip setuptools wheel --quiet\n",
"!pip install dm-acme[jax] --quiet\n",
"!pip install dm-sonnet --quiet\n",
"!pip install trfl --quiet\n",
"!pip install numpy==1.23.3 --quiet --ignore-installed\n",
"!pip uninstall seaborn -y --quiet\n",
"!pip install seaborn --quiet"
"!pip install jedi --quiet --root-user-action=ignore\n",
"!pip install --upgrade pip setuptools wheel --quiet --root-user-action=ignore\n",
"!pip install dm-acme[jax] --quiet --root-user-action=ignore\n",
"!pip install dm-sonnet --quiet --root-user-action=ignore\n",
"!pip install trfl --quiet --root-user-action=ignore\n",
"!pip install numpy==1.23.3 --quiet --ignore-installed --root-user-action=ignore\n",
"!pip uninstall seaborn -y --quiet --root-user-action=ignore\n",
"!pip install seaborn --quiet --root-user-action=ignore"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ torchvision
pathlib
xkcd
decorator==5.0.9
pyvirtualdisplay
tensorboard
moviepy

0 comments on commit 3f18cb9

Please sign in to comment.