Spaces:
Sleeping
Sleeping
Update config.py
Browse files
config.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
from pydantic import BaseSettings, Field
|
2 |
import logging
|
3 |
|
|
|
|
|
|
|
|
|
4 |
class Settings(BaseSettings):
|
5 |
# Default values for the processor and model
|
6 |
processor: str = Field(default="senga-ml/donut-v16")
|
@@ -30,14 +34,14 @@ class Settings(BaseSettings):
|
|
30 |
# You had "donut-16" in some places and "donut-v16" in others
|
31 |
shipper_model_map = {
|
32 |
# Group 1 models - using donut-v16
|
33 |
-
61: {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
34 |
-
81: {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
35 |
-
139: {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
36 |
|
37 |
# Group 2 models - using donut-v17
|
38 |
-
165: {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
39 |
-
127: {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
40 |
-
145: {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
41 |
}
|
42 |
|
43 |
previous_model = self.model
|
@@ -58,7 +62,7 @@ class Settings(BaseSettings):
|
|
58 |
|
59 |
return self.model, self.processor
|
60 |
|
61 |
-
# Create a
|
62 |
settings = Settings()
|
63 |
logger.info(f"Initial model setup: {settings.model}")
|
64 |
|
|
|
1 |
from pydantic import BaseSettings, Field
|
2 |
import logging
|
3 |
|
4 |
+
# Set up logging
|
5 |
+
logging.basicConfig(level=logging.INFO)
|
6 |
+
logger = logging.getLogger(__name__)
|
7 |
+
|
8 |
class Settings(BaseSettings):
|
9 |
# Default values for the processor and model
|
10 |
processor: str = Field(default="senga-ml/donut-v16")
|
|
|
34 |
# You had "donut-16" in some places and "donut-v16" in others
|
35 |
shipper_model_map = {
|
36 |
# Group 1 models - using donut-v16
|
37 |
+
"61": {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
38 |
+
"81": {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
39 |
+
"139": {"model": "senga-ml/donut-v16", "processor": "senga-ml/donut-v16"},
|
40 |
|
41 |
# Group 2 models - using donut-v17
|
42 |
+
"165": {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
43 |
+
"127": {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
44 |
+
"145": {"model": "senga-ml/donut-v17", "processor": "senga-ml/donut-v17"},
|
45 |
}
|
46 |
|
47 |
previous_model = self.model
|
|
|
62 |
|
63 |
return self.model, self.processor
|
64 |
|
65 |
+
# Create a singleton instance
|
66 |
settings = Settings()
|
67 |
logger.info(f"Initial model setup: {settings.model}")
|
68 |
|