This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |