Upload from GitHub Actions: fixed import error
Browse files- evals/backend.py +6 -1
evals/backend.py
CHANGED
@@ -4,7 +4,12 @@ import os
|
|
4 |
import numpy as np
|
5 |
import pandas as pd
|
6 |
import uvicorn
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
8 |
from fastapi import FastAPI, Request
|
9 |
from fastapi.middleware.cors import CORSMiddleware
|
10 |
from fastapi.middleware.gzip import GZipMiddleware
|
|
|
4 |
import numpy as np
|
5 |
import pandas as pd
|
6 |
import uvicorn
|
7 |
+
try:
|
8 |
+
# When executed as a package module (uvicorn evals.backend:app)
|
9 |
+
from .countries import make_country_table
|
10 |
+
except ImportError:
|
11 |
+
# When executed without package context (uvicorn backend:app with cwd at evals/)
|
12 |
+
from countries import make_country_table
|
13 |
from fastapi import FastAPI, Request
|
14 |
from fastapi.middleware.cors import CORSMiddleware
|
15 |
from fastapi.middleware.gzip import GZipMiddleware
|