Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions promptsource/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import argparse
import textwrap
from multiprocessing import Manager, Pool
from itertools import repeat
from multiprocessing import Manager
from multiprocessing.pool import ThreadPool

import pandas as pd
import plotly.express as px
Expand Down Expand Up @@ -138,11 +140,11 @@ def show_text(t, width=WIDTH, with_markdown=False):
all_infos = manager.dict()
all_datasets = list(set([t[0] for t in template_collection.keys]))

def get_infos(d_name):
def get_infos(d_name, all_infos):
all_infos[d_name] = get_dataset_infos(d_name)

pool = Pool(processes=len(all_datasets))
pool.map(get_infos, all_datasets)
pool = ThreadPool(processes=len(all_datasets))
pool.starmap(get_infos, zip(all_datasets, repeat(all_infos)))
pool.close()
pool.join()

Expand Down