marcelcastrobr commited on
Commit
fb3b31f
1 Parent(s): c995fd5

update of application

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,7 +12,7 @@ def sequence_to_classify(sequence, labels):
12
  response1 = classifier(sequence, label_clean, hypothesis_template=hypothesis_template, multi_class=True)
13
  labels = response1['labels']
14
  scores = response1['scores']
15
- clean_output1 = {idx: float(scores.pop(0)) for idx in label_clean}
16
 
17
  print("response is:{}".format(response))
18
  print(type(response))
@@ -40,7 +40,7 @@ iface = gr.Interface(
40
  gr.inputs.Textbox(lines=2,
41
  label="Possible candidate labels",
42
  placeholder="labels here...")],
43
- outputs=gr.outputs.Label(num_top_classes=3, label="Categories"),
44
  capture_session=True,
45
  interpretation="default"
46
  ,examples=[
 
12
  response1 = classifier(sequence, label_clean, hypothesis_template=hypothesis_template, multi_class=True)
13
  labels = response1['labels']
14
  scores = response1['scores']
15
+ clean_output1 = {labels[idx]: float(scores.pop(0)) for idx in len(labels)}
16
 
17
  print("response is:{}".format(response))
18
  print(type(response))
 
40
  gr.inputs.Textbox(lines=2,
41
  label="Possible candidate labels",
42
  placeholder="labels here...")],
43
+ outputs=gr.outputs.Label(num_top_classes=3),
44
  capture_session=True,
45
  interpretation="default"
46
  ,examples=[