nathanael-fijalkow commited on
Commit
39a0b64
·
1 Parent(s): d561f35

fix submit to include tokenizer

Browse files
Files changed (1) hide show
  1. submit.py +8 -0
submit.py CHANGED
@@ -81,6 +81,14 @@ def main():
81
  # Save model and tokenizer
82
  model.save_pretrained(tmp_path)
83
  tokenizer.save_pretrained(tmp_path)
 
 
 
 
 
 
 
 
84
 
85
  # Create model card with submitter info
86
  model_card = f"""---
 
81
  # Save model and tokenizer
82
  model.save_pretrained(tmp_path)
83
  tokenizer.save_pretrained(tmp_path)
84
+
85
+ # Copy tokenizer.py to allow loading with trust_remote_code=True
86
+ # This ensures the custom ChessTokenizer can be loaded from the Hub
87
+ tokenizer_src = Path(__file__).parent / "src" / "tokenizer.py"
88
+ if tokenizer_src.exists():
89
+ import shutil
90
+ shutil.copy(tokenizer_src, tmp_path / "tokenizer.py")
91
+ print(" Included tokenizer.py for remote loading")
92
 
93
  # Create model card with submitter info
94
  model_card = f"""---