diff --git a/lit_nlp/app.py b/lit_nlp/app.py index a83eabb7..9ae3a30a 100644 --- a/lit_nlp/app.py +++ b/lit_nlp/app.py @@ -1018,6 +1018,13 @@ def __init__( index_file='static/index.html', ) + def get_dataset_specs(self) -> dict[str, dict[str, str]]: + datasets_with_spec = collections.defaultdict(dict) + for name, ds in self._datasets.items(): + for field_name, lit_data_class in ds.spec().items(): + datasets_with_spec[name][field_name] = type(lit_data_class).__name__ + return datasets_with_spec + def save_cache(self): for m in self._models.values(): if isinstance(m, caching.CachingModelWrapper):