Jiahuita commited on
Commit
f4e5a43
·
1 Parent(s): 8b4bf9e

Fix deployment issues

Browse files
__pycache__/pipeline.cpython-39.pyc CHANGED
Binary files a/__pycache__/pipeline.cpython-39.pyc and b/__pycache__/pipeline.cpython-39.pyc differ
 
config.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:81be9128702e1663bf6780233ee168b71b7299c2e42438fbb4a9129bcda41b18
3
- size 265
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:459b49b28436622ac5c9f6e28171fb7d0acc9498e293876b5778846501c4ab94
3
+ size 212
pipeline.py CHANGED
@@ -20,7 +20,9 @@ class NewsClassifierPipeline(Pipeline):
20
  def _forward(self, inputs):
21
  processed = self.preprocess(inputs)
22
  predictions = self.model.predict(processed)
23
- return [{"label": "foxnews" if predictions[0][0] > 0.5 else "nbc", "score": float(predictions[0][0])}]
 
 
24
 
25
- def postprocess(self, model_outputs):
26
- return model_outputs
 
20
  def _forward(self, inputs):
21
  processed = self.preprocess(inputs)
22
  predictions = self.model.predict(processed)
23
+ label = "foxnews" if predictions[0][0] > 0.5 else "nbc"
24
+ score = predictions[0][0] if label == "foxnews" else 1 - predictions[0][0]
25
+ return [{"label": label, "score": float(score)}]
26
 
27
+ def postprocess(self, outputs):
28
+ return outputs
tokenizer_config.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1086840ea0ebc3204daeb3f3fd609fbe7cc022dfcb343b72bffc76308a5c9054
3
- size 186