From 711f10853205321ee7f09419e4ae09d54059ce43 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 6 Dec 2018 16:04:12 +0100 Subject: [PATCH] Fix cytoolz import cytoolz --- spacy/cli/profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/profile.py b/spacy/cli/profile.py index 439ef79a1..45e97b8ba 100644 --- a/spacy/cli/profile.py +++ b/spacy/cli/profile.py @@ -8,7 +8,7 @@ import cProfile import pstats import sys import tqdm -import cytoolz +import itertools import thinc.extra.datasets from wasabi import Printer @@ -40,7 +40,7 @@ def profile(model, inputs=None, n_texts=10000): with msg.loading("Loading model '{}'...".format(model)): nlp = load_model(model) msg.good("Loaded model '{}'".format(model)) - texts = list(cytoolz.take(n_texts, inputs)) + texts = list(itertools.islice(inputs, n_texts)) cProfile.runctx("parse_texts(nlp, texts)", globals(), locals(), "Profile.prof") s = pstats.Stats("Profile.prof") msg.divider("Profile stats")