StevenLimcorn commited on
Commit
5596de2
1 Parent(s): 8a8ccdb

Change return_all_tensors to top_k=None for classification pipeline

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils.py +1 -1
app.py CHANGED
@@ -122,4 +122,4 @@ if __name__ == "__main__":
122
  demo = gr.TabbedInterface(
123
  demo_interface["demo"], demo_interface["titles"], theme="soft"
124
  )
125
- demo.launch(debug=True)
 
122
  demo = gr.TabbedInterface(
123
  demo_interface["demo"], demo_interface["titles"], theme="soft"
124
  )
125
+ demo.launch()
utils.py CHANGED
@@ -33,7 +33,7 @@ def sentence_similarity(text: str, documents: list[str], pipe: SentenceSimilarit
33
  # Text Analysis
34
  def cls_inference(input: list[str], pipe: pipeline) -> str:
35
  results = pipe(input, top_k=None)
36
- return {x["label"]: x["score"] for x in results[0]}
37
 
38
 
39
  def text_interface(
 
33
  # Text Analysis
34
  def cls_inference(input: list[str], pipe: pipeline) -> str:
35
  results = pipe(input, top_k=None)
36
+ return {x["label"]: x["score"] for x in results}
37
 
38
 
39
  def text_interface(