Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -101,8 +101,9 @@ with gr.Blocks(title="Textile Machinery NER Demo") as demo:
|
|
101 |
sample = next(dataset_iter)['text']
|
102 |
return sample
|
103 |
except StopIteration:
|
104 |
-
break
|
105 |
-
|
|
|
106 |
|
107 |
# Connect refresh button
|
108 |
refresh_btn.click(fn=get_new_snippet, outputs=input_text)
|
|
|
101 |
sample = next(dataset_iter)['text']
|
102 |
return sample
|
103 |
except StopIteration:
|
104 |
+
break # Exit the loop if we run out of snippets
|
105 |
+
attempts += 1 # Increment attempts
|
106 |
+
return "No more snippets available." # Return this if no valid snippets are found
|
107 |
|
108 |
# Connect refresh button
|
109 |
refresh_btn.click(fn=get_new_snippet, outputs=input_text)
|