Tuchuanhuhuhu commited on
Commit
531abe2
·
1 Parent(s): 18731f2

解决llama不会自动终止的问题

Browse files
Files changed (1) hide show
  1. modules/models.py +1 -1
modules/models.py CHANGED
@@ -383,7 +383,7 @@ class LLaMA_Client(BaseLLMModel):
383
  temperature=self.temperature,
384
  )
385
  response = output_dataset.to_dict()["instances"][0]["text"]
386
- if response == "":
387
  break
388
  partial_text += response
389
  yield partial_text
 
383
  temperature=self.temperature,
384
  )
385
  response = output_dataset.to_dict()["instances"][0]["text"]
386
+ if response == "" or response == self.end_string:
387
  break
388
  partial_text += response
389
  yield partial_text