Update backend.py
Browse files- backend.py +3 -10
backend.py
CHANGED
@@ -1,13 +1,3 @@
|
|
1 |
-
from huggingface_hub import InferenceClient
|
2 |
-
IS_SPACES_ZERO = os.environ.get("SPACES_ZERO_GPU", "0") == "1"
|
3 |
-
IS_SPACE = os.environ.get("SPACE_ID", None) is not None
|
4 |
-
|
5 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
6 |
-
LOW_MEMORY = os.getenv("LOW_MEMORY", "0") == "1"
|
7 |
-
print(f"Using device: {device}")
|
8 |
-
print(f"low memory: {LOW_MEMORY}")
|
9 |
-
|
10 |
-
|
11 |
import os
|
12 |
import pandas as pd
|
13 |
import requests
|
@@ -21,6 +11,9 @@ import textwrap
|
|
21 |
from haversine import haversine
|
22 |
from geopy.geocoders import Nominatim
|
23 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
24 |
|
25 |
# Constants
|
26 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import pandas as pd
|
3 |
import requests
|
|
|
11 |
from haversine import haversine
|
12 |
from geopy.geocoders import Nominatim
|
13 |
from huggingface_hub import InferenceClient
|
14 |
+
import os
|
15 |
+
IS_SPACES_ZERO = os.environ.get("SPACES_ZERO_GPU", "0") == "1"
|
16 |
+
IS_SPACE = os.environ.get("SPACE_ID", None) is not None
|
17 |
|
18 |
# Constants
|
19 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|