tiny-llm
tiny-llm copied to clipboard
fix: f-string syntax fix for old python env
When I run pdm run test-refsol -- -- -k week_1
src/tiny_llm_ref/__init__.py:7: in <module>
from .generate import *
E File "/Users/gao/develop/tiny-llm/src/tiny_llm_ref/generate.py", line 134
E print(f"+{progress} {text.replace('\n', ' ')[-80:]}")
E ^
E SyntaxError: f-string expression part cannot include a backslash
For python3.11, python f-strings cannot contain backslashes inside the expression part (the {} section). This PR fixes the issue in src/tiny_llm_ref/generate.py:134 by extracting '\n' to a variable first.