Spaces:
Sleeping
Sleeping
Update api.py
Browse files
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
|
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:
|