VNAT commited on
Commit
4b74e8d
1 Parent(s): daba3f8

fix script according to author's advice

Browse files
Files changed (1) hide show
  1. batched_inference.py +5 -6
batched_inference.py CHANGED
@@ -95,12 +95,11 @@ def train(tagging_is_running, model, dataloader, train_data, output_queue):
95
 
96
 
97
  def tag_writer(tagging_is_running, output_queue, threshold):
98
- with open("tags_8034.json", "r") as file:
99
- tags = json.load(file)
100
- allowed_tags = sorted(tags)
101
- del tags
102
- allowed_tags.extend(["placeholder0"])
103
- tag_count = len(allowed_tags)
104
  assert tag_count == 8035, f"The length of tag list is not correct. Correct: 8035, current: {tag_count}"
105
 
106
  while not (tagging_is_running.qsize() > 0 and output_queue.qsize() > 0):
 
95
 
96
 
97
  def tag_writer(tagging_is_running, output_queue, threshold):
98
+ with open("tags_8034.json", "r") as f:
99
+ tags = json.load(f)
100
+ tags.append("placeholder0")
101
+ tags = sorted(tags)
102
+ tag_count = len(tags)
 
103
  assert tag_count == 8035, f"The length of tag list is not correct. Correct: 8035, current: {tag_count}"
104
 
105
  while not (tagging_is_running.qsize() > 0 and output_queue.qsize() > 0):