Skip to content

Instantly share code, notes, and snippets.

View JohannesAck's full-sized avatar
🗼

Johannes Ackermann JohannesAck

🗼
View GitHub Profile
@JohannesAck
JohannesAck / crash_example.py
Created July 11, 2024 03:48
https://github.com/CarperAI/trlx/blob/main/examples/ppo_sentiments_llama.py, but replaced with Pythia70M to run faster, and incrased checkpoint frequency
# Generates positive movie reviews by tuning a pretrained model on IMDB dataset
# with a sentiment reward function
import json
import os
import sys
from typing import List
import torch
from datasets import load_dataset
from transformers import pipeline, AutoTokenizer
@JohannesAck
JohannesAck / gradioslowlargeimagesdemo.ipynb
Created February 8, 2023 03:23
GradioSlowLargeImagesDemo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JohannesAck
JohannesAck / multiscaleblendeddiffusioncolab.ipynb
Last active December 5, 2022 07:57
Demo for our approach called "Multi-Scale Blended Diffusion". See https://github.com/pfnet-research/multi-stage-blended-diffusion for more details.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JohannesAck
JohannesAck / iclr_first_session_filter.js
Last active April 24, 2022 11:58
Filters the posters view for ICLR's first session to exclude session 10,11,12...
card_list = document.getElementsByClassName("cards row")[0];
n_cards = card_list.childNodes.length;
var ids_to_delete = [];
for (let i = 0; i<n_cards; i++){
el = card_list.childNodes[i];
if (el.__data__.sessions[0] != 'Poster Session 1'){
ids_to_delete.push(i)
}
}
ids_to_delete = ids_to_delete.reverse()