%%capture modal_output
if __name__ == "__main__":
with stub.run():
start_time = time.time()
print("Loading Data")
df = pd.read_csv("tweets.csv", lineterminator='\n')
df_sample = df.sample(15_000).reset_index(drop=True)
print("Running batch prediction...")
predictor = ZeroShotClassification()
predictions = list(predictor.predict.map(df_sample['text'].values))
pred_df = pd.DataFrame(predictions)
pred_df.to_csv("tweets_labeled.csv", index=False)
end_time = time.time()
print("Elapsed time was %g seconds" % (end_time - start_time))