Skip to content

Instantly share code, notes, and snippets.

View tomaarsen's full-sized avatar

Tom Aarsen tomaarsen

View GitHub Profile
@tomaarsen
tomaarsen / cookiecutter.sh
Created April 21, 2023 12:00
Checkout a working, updated RAFT Submission repo
# Clone the full original repo into a local directory
git clone https://huggingface.co/datasets/ought/raft-submission local-raft-submission
cd local-raft-submission
# Fetch the PR and place it in a branch called pr/3
git fetch origin pr/3:pr/3
# Checkout the new branch
git checkout pr/3
@tomaarsen
tomaarsen / demo.py
Created April 20, 2023 12:33
Logging losses for SetFit
import functools
from dataclasses import dataclass
from typing import Callable
from datasets import load_dataset
from sentence_transformers.losses import CosineSimilarityLoss
from torch import nn
import wandb
from setfit import SetFitModel, SetFitTrainer, sample_dataset
@tomaarsen
tomaarsen / tnp_example.py
Last active September 8, 2019 09:40
Python The Noun Project API Wrapper example
# See the Documentation for more information: https://cubiedev.github.io/TheNounProjectAPI
# Install Module using "pip install TheNounProjectAPI".
# This sample works for version >= 1.0.5
from TheNounProjectAPI import API
if __name__ == "__main__":
# API Key and Secret from https://api.thenounproject.com/getting_started.html#creating-an-api-key
key = "<my api key>"
secret = "<my api secret>"