Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
#
|
2 |
import os
|
3 |
import logging
|
4 |
import torch
|
@@ -13,6 +13,28 @@ from datetime import datetime
|
|
13 |
from dataclasses import dataclass, field
|
14 |
from dotenv import load_dotenv
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Retrieve secrets securely from environment variables
|
17 |
kaggle_username = os.getenv("KAGGLE_USERNAME")
|
18 |
kaggle_key = os.getenv("KAGGLE_KEY")
|
|
|
1 |
+
# Core imports
|
2 |
import os
|
3 |
import logging
|
4 |
import torch
|
|
|
13 |
from dataclasses import dataclass, field
|
14 |
from dotenv import load_dotenv
|
15 |
|
16 |
+
# Initialize logging
|
17 |
+
logging.basicConfig(
|
18 |
+
level=logging.INFO,
|
19 |
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
20 |
+
)
|
21 |
+
logger = logging.getLogger(__name__)
|
22 |
+
|
23 |
+
# Optional imports with error handling
|
24 |
+
try:
|
25 |
+
import wandb
|
26 |
+
WANDB_AVAILABLE = True
|
27 |
+
except ImportError:
|
28 |
+
logger.warning("wandb not installed, tracking disabled")
|
29 |
+
WANDB_AVAILABLE = False
|
30 |
+
|
31 |
+
try:
|
32 |
+
from datasets import load_dataset
|
33 |
+
DATASETS_AVAILABLE = True
|
34 |
+
except ImportError:
|
35 |
+
logger.warning("datasets not installed, demo dataset loading disabled")
|
36 |
+
DATASETS_AVAILABLE = False
|
37 |
+
|
38 |
# Retrieve secrets securely from environment variables
|
39 |
kaggle_username = os.getenv("KAGGLE_USERNAME")
|
40 |
kaggle_key = os.getenv("KAGGLE_KEY")
|