yoinked commited on
Commit
14b7d25
1 Parent(s): a950000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -115,7 +115,8 @@ class WaifuDiffusionInterrogator:
115
  tags = dict(full_tags[full_tags['category'] != 9][['name', 'confidence']].values)
116
  self.cache[imgByteArr] = (ratings, tags)
117
  if len(self.cache) > 25:
118
- self.cache.popitem(last=False)
 
119
 
120
  return ratings, tags
121
 
 
115
  tags = dict(full_tags[full_tags['category'] != 9][['name', 'confidence']].values)
116
  self.cache[imgByteArr] = (ratings, tags)
117
  if len(self.cache) > 25:
118
+ k = next(iter(self.cache))
119
+ v = self.cache.pop(k)
120
 
121
  return ratings, tags
122