Spaces:
Runtime error
Runtime error
Commit
·
962c2a7
1
Parent(s):
5fee57f
Update main.py
Browse files
main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import fastf1
|
2 |
import pandas as pd
|
3 |
from fastapi import FastAPI
|
|
|
4 |
|
5 |
|
6 |
|
@@ -14,7 +15,9 @@ async def root():
|
|
14 |
@app.get("/{year}/{race}/{session}", response_model=None)
|
15 |
async def get_data(year: int, race: int, session: str) -> any:
|
16 |
|
17 |
-
|
|
|
|
|
18 |
|
19 |
f1session = fastf1.get_session(year, race, session)
|
20 |
f1session.load(telemetry=False, weather=False, messages=False)
|
|
|
1 |
import fastf1
|
2 |
import pandas as pd
|
3 |
from fastapi import FastAPI
|
4 |
+
import os
|
5 |
|
6 |
|
7 |
|
|
|
15 |
@app.get("/{year}/{race}/{session}", response_model=None)
|
16 |
async def get_data(year: int, race: int, session: str) -> any:
|
17 |
|
18 |
+
cache_path = os.path.abspath('Cache')
|
19 |
+
|
20 |
+
fastf1.Cache.enable_cache(cache_path)
|
21 |
|
22 |
f1session = fastf1.get_session(year, race, session)
|
23 |
f1session.load(telemetry=False, weather=False, messages=False)
|