File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 11# Edit flashinfer cascade.py to make it compatible with Python 3.8
22from src .path import root
33import os
4+ import platform
45
5- path = os .path .join (
6- os .environ ["CONDA_PREFIX" ], "lib/python3.8/site-packages/flashinfer/cascade.py"
7- )
8- with open (path , "r" ) as f :
9- content = f .read ()
10- content = content .replace ("list[" , "List[" ).replace (
11- "import Optional" , "import List, Optional"
12- )
13- with open (path , "w" ) as f :
14- f .write (content )
6+ if "3.8" in platform .python_version ():
7+ path = os .path .join (
8+ os .environ ["CONDA_PREFIX" ], "lib/python3.8/site-packages/flashinfer/cascade.py"
9+ )
10+ with open (path , "r" ) as f :
11+ content = f .read ()
12+ content = content .replace ("list[" , "List[" ).replace (
13+ "import Optional" , "import List, Optional"
14+ )
15+ with open (path , "w" ) as f :
16+ f .write (content )
1517
1618import torch
1719import time
You can’t perform that action at this time.
0 commit comments