Merge branch #davanstrien/collection_dataset_viewer' into 'librarian-bots/Alpaca-Style-Datasets-explorer'
Browse files
app.py
CHANGED
|
@@ -53,7 +53,12 @@ def navigate_dataset(dataset_ids, index, direction):
|
|
| 53 |
|
| 54 |
def get_display_name(collection_id):
|
| 55 |
# Strip out the extra ID part of the name
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
try:
|
|
|
|
| 53 |
|
| 54 |
def get_display_name(collection_id):
|
| 55 |
# Strip out the extra ID part of the name
|
| 56 |
+
parts = collection_id.split("/")
|
| 57 |
+
if len(parts) == 2:
|
| 58 |
+
owner, name = parts
|
| 59 |
+
name = re.sub(r"-[a-f0-9]{32}$", "", name)
|
| 60 |
+
return f"{owner}/{name}"
|
| 61 |
+
return collection_id # Return original if not in expected format
|
| 62 |
|
| 63 |
|
| 64 |
try:
|