Spaces:
Sleeping
Sleeping
Update config.py
Browse files
config.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
from pydantic import BaseSettings
|
2 |
from typing import Dict
|
3 |
|
4 |
-
|
5 |
class Settings(BaseSettings):
|
|
|
6 |
model_map: Dict[int, str] = {
|
7 |
61: "donut-v16",
|
8 |
81: "donut-v16",
|
@@ -14,8 +14,7 @@ class Settings(BaseSettings):
|
|
14 |
space_base: str = "senga-ml"
|
15 |
|
16 |
def get_model_url(self, shipper_id: int) -> str:
|
17 |
-
model = self.model_map.get(shipper_id, "default-model")
|
18 |
return f"https://{self.space_base}/{model}"
|
19 |
|
20 |
-
|
21 |
settings = Settings()
|
|
|
1 |
from pydantic import BaseSettings
|
2 |
from typing import Dict
|
3 |
|
|
|
4 |
class Settings(BaseSettings):
|
5 |
+
# A dictionary to map shipper_id to the appropriate model
|
6 |
model_map: Dict[int, str] = {
|
7 |
61: "donut-v16",
|
8 |
81: "donut-v16",
|
|
|
14 |
space_base: str = "senga-ml"
|
15 |
|
16 |
def get_model_url(self, shipper_id: int) -> str:
|
17 |
+
model = self.model_map.get(shipper_id, "default-model")
|
18 |
return f"https://{self.space_base}/{model}"
|
19 |
|
|
|
20 |
settings = Settings()
|