Spaces:
Sleeping
Sleeping
small
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from datasets import load_dataset as load_dataset_hf
|
| 3 |
import os
|
| 4 |
|
| 5 |
# Predefined dataset names (configs will be fetched dynamically)
|
|
@@ -42,11 +42,11 @@ def load_rfm_dataset(dataset_name, config_name):
|
|
| 42 |
def get_available_configs(dataset_name):
|
| 43 |
"""Get available configurations for a dataset."""
|
| 44 |
try:
|
| 45 |
-
|
| 46 |
-
configs =
|
| 47 |
return configs
|
| 48 |
except Exception as e:
|
| 49 |
-
print(f"Error getting configs: {e}")
|
| 50 |
return []
|
| 51 |
|
| 52 |
def update_config_choices_with_custom(dataset_name):
|
|
@@ -79,7 +79,7 @@ def visualize_trajectory(dataset, index, dataset_name=None):
|
|
| 79 |
|
| 80 |
# Get metadata
|
| 81 |
task = item["task"]
|
| 82 |
-
|
| 83 |
is_robot = item["is_robot"]
|
| 84 |
data_source = item["data_source"]
|
| 85 |
|
|
@@ -103,7 +103,7 @@ def visualize_trajectory(dataset, index, dataset_name=None):
|
|
| 103 |
|
| 104 |
**Language Task:** {task}
|
| 105 |
|
| 106 |
-
**
|
| 107 |
|
| 108 |
**Data Type:** {'Robot' if is_robot else 'Human'}
|
| 109 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from datasets import load_dataset as load_dataset_hf, get_dataset_config_names
|
| 3 |
import os
|
| 4 |
|
| 5 |
# Predefined dataset names (configs will be fetched dynamically)
|
|
|
|
| 42 |
def get_available_configs(dataset_name):
|
| 43 |
"""Get available configurations for a dataset."""
|
| 44 |
try:
|
| 45 |
+
# Use the dedicated function to get config names
|
| 46 |
+
configs = get_dataset_config_names(dataset_name)
|
| 47 |
return configs
|
| 48 |
except Exception as e:
|
| 49 |
+
print(f"Error getting configs for {dataset_name}: {e}")
|
| 50 |
return []
|
| 51 |
|
| 52 |
def update_config_choices_with_custom(dataset_name):
|
|
|
|
| 79 |
|
| 80 |
# Get metadata
|
| 81 |
task = item["task"]
|
| 82 |
+
quality_label = item["quality_label"]
|
| 83 |
is_robot = item["is_robot"]
|
| 84 |
data_source = item["data_source"]
|
| 85 |
|
|
|
|
| 103 |
|
| 104 |
**Language Task:** {task}
|
| 105 |
|
| 106 |
+
**Quality Label:** {quality_label}
|
| 107 |
|
| 108 |
**Data Type:** {'Robot' if is_robot else 'Human'}
|
| 109 |
|