Repository navigation
Address post-merge review of the chat JSONL blend and the Super VL QAD tutorial #2863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8ea9b35
54a6ce0
0f2d986
c28c50c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,8 +199,9 @@ def _to_chat( | |
| if row.get(key): | ||
| chat[key] = row[key] | ||
| else: | ||
| text = row.get("text") or "" | ||
| if not text: | ||
| text = row.get("text") | ||
| # A non-string value (e.g. a list) would otherwise pass as list content. | ||
| if not isinstance(text, str) or not text: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [SUGGESTION] This type check is the right fix for For That works today, but it's fragile in a way specific to this function: if if content_field == "messages":
messages = row.get("messages")
if not messages or not isinstance(messages, list):
return NonePer CONTRIBUTING's "fix the bug cause, not the side effect", this is the cause; the broad |
||
| return None | ||
| if "<extra_id_" not in text: | ||
| return {"messages": [{"role": "assistant", "content": text}]} | ||
|
|
@@ -277,9 +278,16 @@ def _take_chat_rows( | |
| max_rejected = 10 * want + 100 | ||
| try: | ||
| for row in _iter_rows(source, output_dir, shuffle, seed): | ||
| chat = _to_chat(row, source["content_field"], reasoning_content) | ||
| # Judge the source row's top-level media keys too, which the conversion does not keep. | ||
| if chat is None or not is_text_only_chat_example({**row, **chat}): | ||
| try: | ||
| chat = _to_chat(row, source["content_field"], reasoning_content) | ||
| # Judge the source row's top-level media keys too, which the conversion drops. | ||
| if chat is not None and not is_text_only_chat_example({**row, **chat}): | ||
| chat = None | ||
| except (AttributeError, KeyError, TypeError, ValueError) as e: | ||
| # As in the tokenizing reader: one malformed record must not lose the source. | ||
| print(f"[WARN] {name}: skipping a row that cannot be converted: {e!r}", flush=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [SUGGESTION] This warning is unbounded and prints once per rejected row. The existing malformed-JSONL warning in Consider capping it, e.g. warn on the first few and then let the existing except (AttributeError, KeyError, TypeError, ValueError) as e:
# As in the tokenizing reader: one malformed record must not lose the source.
if unconvertible < 5:
print(f"[WARN] {name}: skipping a row that cannot be converted: {e!r}", flush=True)
unconvertible += 1
chat = NoneReporting |
||
| chat = None | ||
|
Comment on lines
+281
to
+289
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [IMPORTANT Compatibility] The per-row
The consequence: instead of one clear Hoist the lookup out of the loop so a config error can't be mistaken for data: content_field = source["content_field"]
...
for row in _iter_rows(source, output_dir, shuffle, seed):
try:
chat = _to_chat(row, content_field, reasoning_content)That keeps the intended fix (a malformed row is skipped) while a malformed source still fails on the first access, before any rows are read. |
||
| if chat is None: | ||
| rejected += 1 | ||
| if rejected > max_rejected: | ||
| break | ||
|
|
@@ -288,7 +296,7 @@ def _take_chat_rows( | |
| if len(rows) >= want: | ||
| break | ||
| except Exception as e: # e.g. a gated split, or a schema the streaming reader cannot cast | ||
| raise RuntimeError(f"{name}: failed to read or convert") from e | ||
| raise RuntimeError(f"{name}: failed to read") from e | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [SUGGESTION] The outer The inner handler only catches Either keep the outer message honest, or make the inner catch the only conversion boundary. The cheapest fix is the former: except Exception as e: # e.g. a gated split, or a schema the streaming reader cannot cast
raise RuntimeError(f"{name}: failed to read or convert") from eand revert the matching test change. If the intent really is "the outer handler is read-only now", then the inner |
||
| if len(rows) < want: | ||
| gave_up = rejected > max_rejected | ||
| reason = f"gave up after {rejected} rejected rows" if gave_up else "source exhausted" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION] This
--max-model-lenexception contradicts the "same vLLM settings" claim the results table rests on.Line 17 says "All checkpoints were served with the same vLLM settings (see Section 5)", and the whole point of the new note above the table is to be precise about what the numbers do and don't represent. But MMLU-ProX — the one benchmark with a large, surprising QAD gain (74.41 → 81.15, the row that gets its own paragraph of explanation) — was served at
32768rather than262144.A reader comparing the MMLU-ProX column will want to know whether that 32768 applied to all three checkpoints or only some. If it applied to all three uniformly the comparison is sound and one clause fixes it; if not, the row isn't apples-to-apples and that matters a lot given it's the headline movement. Either way it's worth stating rather than leaving in a parenthetical two tables away from the claim it qualifies.
Suggest saying it explicitly at line 17, e.g. "All checkpoints were served with the same vLLM settings (see Section 5), MMLU-ProX at
--max-model-len 32768for all three", and then the parenthetical here is just a pointer rather than the only mention.