Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
# adding a comment
|
| 2 |
import gradio as gr
|
| 3 |
-
from datasets import load_dataset
|
| 4 |
import os
|
| 5 |
|
| 6 |
def load_rfm_dataset(dataset_name, config_name):
|
| 7 |
"""Load the RFM dataset from HuggingFace Hub."""
|
| 8 |
|
| 9 |
-
dataset =
|
| 10 |
return dataset, f"✅ Loaded {len(dataset)} trajectories from {dataset_name}/{config_name}"
|
| 11 |
|
| 12 |
def get_available_configs(dataset_name):
|
| 13 |
"""Get available configurations for a dataset."""
|
| 14 |
try:
|
| 15 |
-
dataset_info =
|
| 16 |
configs = list(dataset_info.keys())
|
| 17 |
return configs
|
| 18 |
except Exception as e:
|
|
|
|
| 1 |
# adding a comment
|
| 2 |
import gradio as gr
|
| 3 |
+
from datasets import load_dataset as load_dataset_hf
|
| 4 |
import os
|
| 5 |
|
| 6 |
def load_rfm_dataset(dataset_name, config_name):
|
| 7 |
"""Load the RFM dataset from HuggingFace Hub."""
|
| 8 |
|
| 9 |
+
dataset = load_dataset_hf(dataset_name, name=config_name)
|
| 10 |
return dataset, f"✅ Loaded {len(dataset)} trajectories from {dataset_name}/{config_name}"
|
| 11 |
|
| 12 |
def get_available_configs(dataset_name):
|
| 13 |
"""Get available configurations for a dataset."""
|
| 14 |
try:
|
| 15 |
+
dataset_info = load_dataset_hf(dataset_name, trust_remote_code=True)
|
| 16 |
configs = list(dataset_info.keys())
|
| 17 |
return configs
|
| 18 |
except Exception as e:
|