VictorSanh commited on
Commit
28b31c4
1 Parent(s): d06562a

normal generate mode fix

Browse files
the_updated_app_with_tfrm_integration.py CHANGED
@@ -192,10 +192,10 @@ def model_inference(
192
  inputs = {k: v.to(DEVICE) for k, v in inputs.items()}
193
  generation_args.update(inputs)
194
 
195
- # # The regular non streaming generation mode (it returns the prompt too though)
196
  # _ = generation_args.pop("streamer")
197
  # generated_ids = MODELS[model_selector].generate(**generation_args)
198
- # generated_text = PROCESSOR.batch_decode(generated_ids, skip_special_tokens=True)[0]
199
  # return generated_text
200
 
201
  # The streaming generation mode
 
192
  inputs = {k: v.to(DEVICE) for k, v in inputs.items()}
193
  generation_args.update(inputs)
194
 
195
+ # # The regular non streaming generation mode
196
  # _ = generation_args.pop("streamer")
197
  # generated_ids = MODELS[model_selector].generate(**generation_args)
198
+ # generated_text = PROCESSOR.batch_decode(generated_ids[:, generation_args["input_ids"].size(-1): ], skip_special_tokens=True)[0]
199
  # return generated_text
200
 
201
  # The streaming generation mode