Spaces:
Runtime error
Runtime error
Fix logger initialization order - logger must be defined before use
Browse files
app.py
CHANGED
|
@@ -31,6 +31,10 @@ import torch
|
|
| 31 |
# Import from bot.py
|
| 32 |
from bot import RAGBot, parse_args, Chunk
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# For Hugging Face Inference API
|
| 35 |
try:
|
| 36 |
from huggingface_hub import InferenceClient
|
|
@@ -39,10 +43,6 @@ except ImportError:
|
|
| 39 |
HF_INFERENCE_AVAILABLE = False
|
| 40 |
logger.warning("huggingface_hub not available, InferenceClient will not work")
|
| 41 |
|
| 42 |
-
# Set up logging
|
| 43 |
-
logging.basicConfig(level=logging.INFO)
|
| 44 |
-
logger = logging.getLogger(__name__)
|
| 45 |
-
|
| 46 |
# Model mapping: short name -> full HuggingFace path
|
| 47 |
MODEL_MAP = {
|
| 48 |
"Llama-3.2-3B-Instruct": "meta-llama/Llama-3.2-3B-Instruct",
|
|
|
|
| 31 |
# Import from bot.py
|
| 32 |
from bot import RAGBot, parse_args, Chunk
|
| 33 |
|
| 34 |
+
# Set up logging first (before any logger usage)
|
| 35 |
+
logging.basicConfig(level=logging.INFO)
|
| 36 |
+
logger = logging.getLogger(__name__)
|
| 37 |
+
|
| 38 |
# For Hugging Face Inference API
|
| 39 |
try:
|
| 40 |
from huggingface_hub import InferenceClient
|
|
|
|
| 43 |
HF_INFERENCE_AVAILABLE = False
|
| 44 |
logger.warning("huggingface_hub not available, InferenceClient will not work")
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Model mapping: short name -> full HuggingFace path
|
| 47 |
MODEL_MAP = {
|
| 48 |
"Llama-3.2-3B-Instruct": "meta-llama/Llama-3.2-3B-Instruct",
|