Skip to content

Conversation

@chasingegg
Copy link

@chasingegg chasingegg commented Nov 9, 2025

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.

Extract newline character to a variable to avoid backslash in f-string expression part.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant