Spaces:
Running
fix: Revert to non-streaming dataset loading for better UX
Browse filesChanged default dataset loading from streaming to full download to fix
first-load data display issues.
**Problem:**
- With streaming=True, data loads asynchronously
- Users saw empty screens on first app load
- Data appeared only after navigation (once streaming completed)
**Solution:**
- Changed use_streaming default: True → False
- App now pre-loads full dataset before creating Gradio interface
- Users see data immediately on first access
- No more empty screen issues
**Performance:**
- Slightly longer initial app startup (~5-10 seconds)
- Much better user experience - no confusion
- Data is cached after first load, so subsequent access is instant
Users can still enable streaming via USE_STREAMING=true environment variable
if they prefer faster startup over immediate data availability.
- data_loader.py +2 -2
|
@@ -33,7 +33,7 @@ class DataLoader:
|
|
| 33 |
json_data_path: Optional[str] = None,
|
| 34 |
leaderboard_dataset: Optional[str] = None,
|
| 35 |
hf_token: Optional[str] = None,
|
| 36 |
-
use_streaming: bool =
|
| 37 |
):
|
| 38 |
self.data_source = data_source
|
| 39 |
self.json_data_path = Path(json_data_path or os.getenv("JSON_DATA_PATH", "./sample_data"))
|
|
@@ -459,7 +459,7 @@ def create_data_loader_from_env() -> DataLoader:
|
|
| 459 |
Configured DataLoader instance
|
| 460 |
"""
|
| 461 |
data_source = os.getenv("DATA_SOURCE", "both")
|
| 462 |
-
use_streaming = os.getenv("USE_STREAMING", "
|
| 463 |
|
| 464 |
return DataLoader(
|
| 465 |
data_source=data_source,
|
|
|
|
| 33 |
json_data_path: Optional[str] = None,
|
| 34 |
leaderboard_dataset: Optional[str] = None,
|
| 35 |
hf_token: Optional[str] = None,
|
| 36 |
+
use_streaming: bool = False
|
| 37 |
):
|
| 38 |
self.data_source = data_source
|
| 39 |
self.json_data_path = Path(json_data_path or os.getenv("JSON_DATA_PATH", "./sample_data"))
|
|
|
|
| 459 |
Configured DataLoader instance
|
| 460 |
"""
|
| 461 |
data_source = os.getenv("DATA_SOURCE", "both")
|
| 462 |
+
use_streaming = os.getenv("USE_STREAMING", "false").lower() == "true"
|
| 463 |
|
| 464 |
return DataLoader(
|
| 465 |
data_source=data_source,
|