codybum commited on
Commit
12fdacc
·
verified ·
1 Parent(s): 9ead922

transformers 4.x + 5.x compatibility: dual RoPE schema (flat rope_theta + nested rope_parameters), model_input_names; verified on 4.57.1 and 5.2.0

Browse files
Files changed (1) hide show
  1. README.md +6 -9
README.md CHANGED
@@ -71,9 +71,8 @@ University of Louisville (Bird), so the code name is fitting.
71
  | **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) |
72
  | **Final train loss** | ≈1.16 |
73
  | **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** |
74
- | **RoPE** | standard 1D, **θ = 25,000** (pin this, see *Serving notes*) |
75
  | **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) |
76
- | **Objective** | **pure cross-entropy** (no auxiliary/geometric losses; no SigReg, no STP, no MTP) |
77
  | **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 |
78
  | **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |
79
 
@@ -434,19 +433,17 @@ tok = AutoTokenizer.from_pretrained(model_id)
434
  model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
435
 
436
  prompt = "IMPRESSION: The chest radiograph demonstrates"
437
- ids = tok(prompt, return_tensors="pt").to(model.device) # add_bos_token=False by design
438
  out = model.generate(**ids, max_new_tokens=128, do_sample=False)
439
  print(tok.decode(out[0], skip_special_tokens=True))
440
  ```
441
 
442
- ### Serving notes (please read; these bite)
443
 
444
- - **`rope_theta = 25000`, not 10000.** Some conversion paths (notably GGUF) silently fall back to
445
- 10,000 and quietly damage long-context behaviour. **Pin it explicitly** when converting.
446
- - **`add_bos_token=False`.** Setting it true double-prepends BOS and breaks generation.
447
- - **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.
448
  - **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.
449
- - Requires `transformers` with the nested `rope_parameters` config schema (≥5.x), or convert the config.
450
 
451
  ---
452
 
 
71
  | **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) |
72
  | **Final train loss** | ≈1.16 |
73
  | **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** |
74
+ | **RoPE** | standard 1D, **θ = 25,000** |
75
  | **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) |
 
76
  | **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 |
77
  | **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |
78
 
 
433
  model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
434
 
435
  prompt = "IMPRESSION: The chest radiograph demonstrates"
436
+ ids = tok(prompt, return_tensors="pt").to(model.device)
437
  out = model.generate(**ids, max_new_tokens=128, do_sample=False)
438
  print(tok.decode(out[0], skip_special_tokens=True))
439
  ```
440
 
441
+ ### Notes
442
 
443
+ - **Works with `transformers` 4.x and 5.x out of the box.** Verified on 4.57.1 and 5.2.0: the snippet
444
+ above runs unchanged on both.
 
 
445
  - **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.
446
+ - **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.
447
 
448
  ---
449