Lin0He commited on
Commit
899681c
·
1 Parent(s): 5dc25dd

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +3 -3
pipeline.py CHANGED
@@ -77,9 +77,9 @@ class PreTrainedPipeline():
77
  self.model = AutoModelForCausalLM.from_pretrained("Lin0He/text-summary-gpt2-short")
78
 
79
 
80
- def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
81
  # process input
82
- inputs = data.pop("inputs", data)
83
  # process input text
84
- prediction = model_infer( self.model, self.tokenizer, inputs['text']+"TL;DR")
85
  return {"text": prediction}
 
77
  self.model = AutoModelForCausalLM.from_pretrained("Lin0He/text-summary-gpt2-short")
78
 
79
 
80
+ def __call__(self, data) -> Dict[str, Any]:
81
  # process input
82
+ #inputs = data.pop("inputs", data)
83
  # process input text
84
+ prediction = model_infer( self.model, self.tokenizer, data+"TL;DR")
85
  return {"text": prediction}