MienOlle commited on
Commit
81adbfa
·
1 Parent(s): a44c152

JSON Format Fixes

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -37,11 +37,11 @@ def predict(input):
37
  rets = logits.argmax(dim = 1).tolist()
38
 
39
  labels = ["positive", "neutral", "negative"]
40
- return {[labels[ret] for ret in rets]}
41
 
42
  @app.post("/predict")
43
  def get_sentiment(data: TextInput):
44
- return predict(data.text)
45
 
46
  if __name__ == "__main__":
47
  import uvicorn
 
37
  rets = logits.argmax(dim = 1).tolist()
38
 
39
  labels = ["positive", "neutral", "negative"]
40
+ return [labels[ret] for ret in rets]
41
 
42
  @app.post("/predict")
43
  def get_sentiment(data: TextInput):
44
+ return {predict(data.text)}
45
 
46
  if __name__ == "__main__":
47
  import uvicorn