VikParuchuri / textbook_quality

Generate textbook-quality synthetic LLM pretraining data
MIT License
461 stars 46 forks source link

Change Prerequisites - Python 3.9+ to Python 3.10+ #13

Open omkar-334 opened 2 months ago

omkar-334 commented 2 months ago

The match-case statement was introduced to Python in v3.10.
When I run the code in Python 3.9.13, It gives me this -
File "C:\Users\omkar\Desktop\textbook_quality\app\llm\llm.py", line 74
match model:
^
SyntaxError: invalid syntax

I encountered another syntax error -
created: datetime | None = Field(
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' The reason for this is -
datetime | None syntax is only supported in 3.10 or later.
A solution for this could be -
from typing import Optional
name: Optional[datetime] = None