Yuchan5386 commited on
Commit
9d91b93
·
verified ·
1 Parent(s): 757cfac

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +1 -2
api.py CHANGED
@@ -201,8 +201,7 @@ def generate_text_typical(model, prompt, max_len=100, max_gen=98,
201
  decoded = decoded.strip()
202
 
203
  if len(generated) >= min_len and (sampled == end_id or decoded.endswith(('.', '!', '?'))):
204
- yield decoded
205
- break
206
 
207
  def is_valid_response(response):
208
  if len(response.strip()) < 2:
 
201
  decoded = decoded.strip()
202
 
203
  if len(generated) >= min_len and (sampled == end_id or decoded.endswith(('.', '!', '?'))):
204
+ return decoded # ← yield 대신 return
 
205
 
206
  def is_valid_response(response):
207
  if len(response.strip()) < 2: