Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a189686
1
Parent(s):
f5e1816
updated
Browse files
__pycache__/inference.cpython-310.pyc
DELETED
|
Binary file (1.44 kB)
|
|
|
vlm_inference.py
CHANGED
|
@@ -170,10 +170,14 @@ def vlm_infer_stream(
|
|
| 170 |
acc, last = [], ""
|
| 171 |
|
| 172 |
for _ in range(max_new_tokens):
|
|
|
|
| 173 |
tid = int(next_token.item())
|
| 174 |
if tid in stop_ids:
|
|
|
|
|
|
|
| 175 |
break
|
| 176 |
|
|
|
|
| 177 |
acc.append(tid)
|
| 178 |
text = tokenizer.decode(acc)
|
| 179 |
if not text.endswith("�"):
|
|
|
|
| 170 |
acc, last = [], ""
|
| 171 |
|
| 172 |
for _ in range(max_new_tokens):
|
| 173 |
+
# sampled from prefill
|
| 174 |
tid = int(next_token.item())
|
| 175 |
if tid in stop_ids:
|
| 176 |
+
# ★ 最小修正:何も出ていないなら1回だけ表示
|
| 177 |
+
yield "[EOS]"
|
| 178 |
break
|
| 179 |
|
| 180 |
+
|
| 181 |
acc.append(tid)
|
| 182 |
text = tokenizer.decode(acc)
|
| 183 |
if not text.endswith("�"):
|