Spaces:
Runtime error
Runtime error
from git import Repo | |
import os | |
GITHUB_PAT = os.environ['GITHUB'] | |
if not os.path.exists('repo_directory'): | |
Repo.clone_from(f'https://tracinginsights:{GITHUB_PAT}@github.com/TracingInsights/fastf1api.git', 'repo_directory' ) | |
from repo_directory import * | |
import datetime | |
import os | |
import streamlit as st | |
import numpy as np | |
import math | |
import fastf1 | |
import pandas as pd | |
from fastapi import FastAPI, Response | |
from fastapi.middleware.cors import CORSMiddleware | |
from fastapi.responses import FileResponse, HTMLResponse | |
from pydantic import BaseModel | |
import functools | |
import math | |
import numpy as np | |
import concurrent.futures | |
import available_data | |
app = FastAPI() | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=["*"], | |
allow_credentials=True, | |
allow_methods=["*"], | |
allow_headers=["*"], | |
) | |
FASTF1_CACHE_DIR = 'cache' #os.environ['FASTF1_CACHE_DIR'] | |
fastf1.Cache.enable_cache(FASTF1_CACHE_DIR) | |