Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Jun 28, 2024
1 parent 86bfac0 commit fa32d5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/make-blacklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def main(args):
with open(os.path.join(folder, 'remote', 'stats.json'), 'r') as f:
stats = json.load(f)

badDatasets = [] # list of tuples (userId, placeId, screenId)
oldBadDatasets = [] # list of tuples (userId, placeId, screenId) strings
if os.path.exists(os.path.join(folder, 'blacklist.json')):
with open(os.path.join(folder, 'blacklist.json'), 'r') as f:
badDatasets = json.load(f)
oldBadDatasets = json.load(f)
pass

model = dict(timesteps=timesteps, stats=stats, use_encoders=False)
Expand All @@ -67,6 +67,7 @@ def main(args):

model = CModelTrainer(**model)
# find folders with the name "/test-*/"
badDatasets = []
for nm in glob.glob(os.path.join(folder, 'test-main', 'test-*/')):
evalDataset = CTestLoader(nm)
loss, dist = evaluate(evalDataset, model)
Expand All @@ -81,6 +82,7 @@ def main(args):
screenId = stats['screenId'][screenId]
res.append((userId, placeId, screenId))
continue
res = oldBadDatasets + res # add the old blacklisted datasets
print('Blacklisted datasets:')
print(json.dumps(res, indent=2))
# save the blacklisted datasets
Expand Down

0 comments on commit fa32d5a

Please sign in to comment.