def load_states_from_file(f): """ Load a stream of states from a file. """ return (State.from_json(json.loads(line)) for line in tqdm(list(f)))
def test_data(): """ Load some data for the embedder. """ with open("tests/data/snli_100.jsonl") as f: return [State.from_json(json.loads(line)) for line in f]