Update README.md
Browse files10 unmodified lines11121314151610 unmodified linesand generates individual characters instead of word groups. More specific characters like "åäö" and emojis are represented with more than one token in the utf8 encoding.**Correct top byte-level prediction**:| Class | ACC (%) |10 unmodified lines11121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636410 unmodified linesand generates individual characters instead of word groups. More specific characters like "åäö" and emojis are represented with more than one token in the utf8 encoding.```pythonfrom transformers import Qwen3ForCausalLMimport torchdevice = "cuda" if torch.cuda.is_available() else "cpu"model = Qwen3ForCausalLM.from_pretrained("qwrt/Swedish1M").to(device)seed = torch.tensor(list("Hej på di".encode()), dtype=torch.long)[None].to(device)out = model.generate(seed, max_new_tokens=1024,do_sample=True, temperature=0.8)print(bytes(out[0].tolist()).decode("utf-8", errors="replace"))```output:```Hej på dig, men jag antar att du inte får se en skönhet längre. Du vet väl inte riktigt att du...```If you want to generate more than 1024 tokens, run this code, it downloads sink_generate.```pythonfrom huggingface_hub import hf_hub_downloadimport importlib.utilfrom transformers import Qwen3ForCausalLMimport torchrepo="qwrt/Swedish1M"file_path = hf_hub_download(repo_id=repo,filename="sink_generate.py")spec = importlib.util.spec_from_file_location("sink_generate", file_path)modul = importlib.util.module_from_spec(spec)spec.loader.exec_module(modul)device = "cuda" if torch.cuda.is_available() else "cpu"model = Qwen3ForCausalLM.from_pretrained(repo).to(device)seed = torch.tensor(list("Det var en gång".encode()), dtype=torch.long)[None].to(device)out = modul.sink_generate(model, seed, max_new_tokens=2000, window=1000, n_sink=0)print(bytes(out[0].tolist()).decode("utf-8", errors="replace"))```**Correct top byte-level prediction**:| Class | ACC (%) |
README.md+48