Skip to content

Instantly share code, notes, and snippets.

View abrichr's full-sized avatar
😄
Building

Richard Abrich abrichr

😄
Building
View GitHub Profile
@abrichr
abrichr / get_pdf.py
Last active August 12, 2024 17:22
Get a PDF by its DOI
"""
Module to download a PDF from Sci-Hub using a provided DOI.
This script uses curl to fetch a PDF from Sci-Hub based on the provided DOI and
saves it to a specified output path.
Example usage:
python get_pdf.py "10.1038/s41586-020-2649-2" "output.pdf"
If no output path is specified, the DOI will be used as the filename with invalid
@abrichr
abrichr / gpt4v.py
Last active July 22, 2024 06:24
Example usage of GPT4-V API
# from https://github.com/OpenAdaptAI/OpenAdapt/blob/44d4a55f332ef3b846933b38854372d4166fd2ea/experiments/gpt4v.py
"""Example usage of GPT4-V API.
Usage:
OPENAI_API_KEY=<your_api_key> python3 gpt4v.py \
[<path/to/image1.png>] [<path/to/image2.jpg>] [...] "text prompt"
Example:
@abrichr
abrichr / install_caffe2_detectron.sh
Last active June 7, 2018 00:47 — forked from matsui528/install_caffe2_detectron.sh
Install script of caffe2 and detectron on AWS EC2 instance with Deep Learning Base AMI
# Install script of Caffe2 and Detectron on AWS EC2
#
# Tested environment:
# - AMI: Deep Learning Base AMI (Ubuntu) Version 3.0 - ami-38c87440 (CUDA is already installed)
# - Instance: p3.2xlarge (V100 * 1)
# - Caffe2: https://github.com/caffe2/caffe2/commit/e1f614a5f8ae92f4ecb828e1d5f84d2cd1fe12bd
# - Detectron: https://github.com/facebookresearch/Detectron/commit/a22302de27f9004422a96414ed4088d05c664978
#
# Usage:
# Launch a fresh EC2 instance, put this script on the /home/ubuntu/, and run the following command.