jbraha commited on
Commit
e88d04f
·
1 Parent(s): 3331829

'mint autosave'

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -19,10 +19,9 @@ labels = {'LABEL_0': 'toxic', 'LABEL_1': 'severe_toxic', 'LABEL_2': 'obscene', '
19
  # make a dictionary of the labels and values
20
  def unpack(result):
21
  output = {}
22
- for res in result:
23
- print(res)
24
- print(output)
25
- output[labels[res['label']]] = res['score']
26
  return output
27
 
28
  def add_to_table(input, result, output):
 
19
  # make a dictionary of the labels and values
20
  def unpack(result):
21
  output = {}
22
+ if type(result) is list:
23
+ for res in result:
24
+ output[labels[res['label']]] = res['score']
 
25
  return output
26
 
27
  def add_to_table(input, result, output):