Spaces:
Running
Running
NotShrirang
commited on
Commit
·
498e5e4
1
Parent(s):
bdc8737
fix: bugs
Browse files
data_upload/data_upload_page.py
CHANGED
@@ -18,7 +18,8 @@ def data_upload(clip_model, preprocess, text_embedding_model):
|
|
18 |
with cols[count]:
|
19 |
st.image(image)
|
20 |
with cols[4]:
|
21 |
-
|
|
|
22 |
st.info(f"Total {len(images)} files selected.")
|
23 |
if st.button("Add Images"):
|
24 |
progress_bar = st.progress(0)
|
|
|
18 |
with cols[count]:
|
19 |
st.image(image)
|
20 |
with cols[4]:
|
21 |
+
if len(images) > 5:
|
22 |
+
st.info(f"and more {len(images) - 5} images...")
|
23 |
st.info(f"Total {len(images)} files selected.")
|
24 |
if st.button("Add Images"):
|
25 |
progress_bar = st.progress(0)
|
model_finetuning/components/model_training_component.py
CHANGED
@@ -34,6 +34,10 @@ def model_training():
|
|
34 |
st.subheader("Data Preview")
|
35 |
st.dataframe(annotations_df.head(), use_container_width=True)
|
36 |
|
|
|
|
|
|
|
|
|
37 |
test_size = st.selectbox("Select Test Size", options=[0.1, 0.2, 0.3, 0.4, 0.5], index=1)
|
38 |
train_df, val_df = train_test_split(annotations_df, test_size=test_size, random_state=42)
|
39 |
if len(train_df) < 2:
|
|
|
34 |
st.subheader("Data Preview")
|
35 |
st.dataframe(annotations_df.head(), use_container_width=True)
|
36 |
|
37 |
+
if len(annotations_df) < 2:
|
38 |
+
st.error("Not enough data to train the model.")
|
39 |
+
return
|
40 |
+
|
41 |
test_size = st.selectbox("Select Test Size", options=[0.1, 0.2, 0.3, 0.4, 0.5], index=1)
|
42 |
train_df, val_df = train_test_split(annotations_df, test_size=test_size, random_state=42)
|
43 |
if len(train_df) < 2:
|