Jiahuita commited on
Commit
38aed7e
1 Parent(s): 4931f6a

Reversed fox and nbc which got wrong

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -69,8 +69,9 @@ async def predict(input_data: PredictionInput):
69
  # Process results
70
  results = []
71
  for pred in predictions:
72
- label = "foxnews" if pred[1] > 0.5 else "nbc"
73
- score = float(pred[1] if label == "foxnews" else 1 - pred[1])
 
74
  results.append({
75
  "label": label,
76
  "score": score
@@ -88,4 +89,4 @@ async def reload_model():
88
  load_model_and_tokenizer()
89
  return {"message": "Model reloaded successfully"}
90
  except Exception as e:
91
- raise HTTPException(status_code=500, detail=str(e))
 
69
  # Process results
70
  results = []
71
  for pred in predictions:
72
+ # Reversed categorization logic
73
+ label = "nbc" if pred[1] > 0.5 else "foxnews"
74
+ score = float(pred[1] if label == "nbc" else 1 - pred[1])
75
  results.append({
76
  "label": label,
77
  "score": score
 
89
  load_model_and_tokenizer()
90
  return {"message": "Model reloaded successfully"}
91
  except Exception as e:
92
+ raise HTTPException(status_code=500, detail=str(e))