Spaces:
Sleeping
Sleeping
Fix test environment initialisation
Browse files
app.py
CHANGED
|
@@ -26,8 +26,10 @@ def main():
|
|
| 26 |
setup_logger()
|
| 27 |
load_api_keys()
|
| 28 |
|
|
|
|
|
|
|
| 29 |
# Initialize the LLM model based on configuration
|
| 30 |
-
model_id = get_model_id()
|
| 31 |
logger.info(f"Initializing with model: {model_id}")
|
| 32 |
|
| 33 |
# If using Ollama, we need to specify the API base URL
|
|
@@ -48,7 +50,7 @@ def main():
|
|
| 48 |
# Determine if we're in test mode (local) or production (HuggingFace)
|
| 49 |
# HuggingFace environment has SPACE_ID environment variable
|
| 50 |
|
| 51 |
-
|
| 52 |
gradio_config = get_gradio_config(is_test)
|
| 53 |
|
| 54 |
# Launch with appropriate configuration
|
|
|
|
| 26 |
setup_logger()
|
| 27 |
load_api_keys()
|
| 28 |
|
| 29 |
+
is_test = os.environ.get('SPACE_ID') is None
|
| 30 |
+
|
| 31 |
# Initialize the LLM model based on configuration
|
| 32 |
+
model_id = get_model_id(is_test=is_test)
|
| 33 |
logger.info(f"Initializing with model: {model_id}")
|
| 34 |
|
| 35 |
# If using Ollama, we need to specify the API base URL
|
|
|
|
| 50 |
# Determine if we're in test mode (local) or production (HuggingFace)
|
| 51 |
# HuggingFace environment has SPACE_ID environment variable
|
| 52 |
|
| 53 |
+
|
| 54 |
gradio_config = get_gradio_config(is_test)
|
| 55 |
|
| 56 |
# Launch with appropriate configuration
|