Skip to content

Commit

Permalink
don't change loop while running
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaxir committed May 7, 2021
1 parent d13a182 commit c648e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aitextgen/aitextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,10 @@ def generate(

# remove fields not in schema_return
if schema_return:
keys = gen_text_dict.keys()
if len(schema_return) == 1:
gen_text_dict = gen_text_dict[schema_return[0]]
for key in gen_text_dict.keys():
for key in keys:
if key not in schema_return:
gen_text_dict.pop(key, None)

Expand Down

0 comments on commit c648e20

Please sign in to comment.