Spaces:
Sleeping
Sleeping
GeorgeSherif commited on
Commit ·
fe1ea6e
1
Parent(s): c74d7c6
updates
Browse files
app.py
CHANGED
|
@@ -111,7 +111,11 @@ def save_annotation(caption, session_data):
|
|
| 111 |
"image_id": [image_id],
|
| 112 |
"caption": [caption],
|
| 113 |
"annotation_count": [annotation_count + 1] # Increment the annotation count
|
| 114 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
# Concatenate with the existing dataset and push the updated dataset to Hugging Face
|
| 117 |
dataset = concatenate_datasets([dataset, new_data])
|
|
|
|
| 111 |
"image_id": [image_id],
|
| 112 |
"caption": [caption],
|
| 113 |
"annotation_count": [annotation_count + 1] # Increment the annotation count
|
| 114 |
+
}, features=Features({
|
| 115 |
+
'image_id': Value(dtype='string'),
|
| 116 |
+
'caption': Value(dtype='string'),
|
| 117 |
+
'annotation_count': Value(dtype='int32') # Ensure int32 type
|
| 118 |
+
}))
|
| 119 |
|
| 120 |
# Concatenate with the existing dataset and push the updated dataset to Hugging Face
|
| 121 |
dataset = concatenate_datasets([dataset, new_data])
|