From c23f04ae4daef44d2e308a2af04bd83c8433465b Mon Sep 17 00:00:00 2001 From: Elron Bandel Date: Sun, 28 Jan 2024 06:55:59 -0500 Subject: [PATCH] Update readme and ruff Signed-off-by: Elron Bandel --- README.md | 8 ++++++++ src/unitxt/catalog.py | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b9ba96c41..3e31696e0 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,14 @@ In the dynamic landscape of generative NLP, traditional text processing pipeline https://github.com/IBM/unitxt/assets/23455264/baef9131-39d4-4164-90b2-05da52919fdf +### 🦄 Currently on Unitxt Catalog + +![NLP Tasks](https://img.shields.io/badge/NLP_tasks-21-blue) +![Dataset Cards](https://img.shields.io/badge/Dataset_Cards-377-blue) +![Templates](https://img.shields.io/badge/Templates-143-blue) +![Formats](https://img.shields.io/badge/Formats-7-blue) +![Metrics](https://img.shields.io/badge/Metrics-47-blue) + ### 🦄 Run Unitxt Exploration Dashboard To launch unitxt graphical user interface run: diff --git a/src/unitxt/catalog.py b/src/unitxt/catalog.py index e58467cc4..980a5105b 100644 --- a/src/unitxt/catalog.py +++ b/src/unitxt/catalog.py @@ -1,14 +1,15 @@ import os import re +from collections import Counter from pathlib import Path from typing import Optional -from collections import Counter + import requests -from .artifact import Artifact, Artifactory, reset_artifacts_cache, Artifactories +from .artifact import Artifact, Artifactories, Artifactory, reset_artifacts_cache from .logging_utils import get_logger -from .version import version from .text_utils import print_dict +from .version import version logger = get_logger() COLLECTION_SEPARATOR = "." @@ -146,12 +147,14 @@ def get_local_catalogs_paths(): result.append(artifactory.location) return result + def count_files_recursively(folder): file_count = 0 for _, _, files in os.walk(folder): file_count += len(files) return file_count + def local_catalog_summary(catalog_path): result = {} @@ -161,9 +164,10 @@ def local_catalog_summary(catalog_path): return result + def summary(): result = Counter() for local_catalog_path in get_local_catalogs_paths(): - result += Counter(local_catalog_summary(local_catalog_path)) + result += Counter(local_catalog_summary(local_catalog_path)) print_dict(result) return result