Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -200,7 +200,7 @@ with gr.Blocks(css="footer {visibility: hidden}") as app:
|
|
200 |
|
201 |
# URL display component - only shown if URL column is defined
|
202 |
if labeler.has_url_column:
|
203 |
-
url_display = gr.
|
204 |
|
205 |
# Main content area (shown with placeholder text)
|
206 |
with gr.Row():
|
@@ -248,13 +248,12 @@ with gr.Blocks(css="footer {visibility: hidden}") as app:
|
|
248 |
# Get the initial data for this session ID
|
249 |
if labeler.has_url_column:
|
250 |
initial_id, initial_left, initial_right, initial_url = labeler.get_current_pair(session_id_value)
|
251 |
-
url_html = f'<a href="{initial_url}" target="_blank">{initial_url}</a>' if initial_url else ""
|
252 |
|
253 |
return (
|
254 |
session_id_value, # session_id state
|
255 |
True, # is_session_started state
|
256 |
labeler.current_index[session_id_value], # current_sample_sld
|
257 |
-
|
258 |
initial_left, # left_output
|
259 |
initial_right, # right_output
|
260 |
initial_id, # item_id
|
@@ -340,12 +339,11 @@ with gr.Blocks(css="footer {visibility: hidden}") as app:
|
|
340 |
new_id, new_left, new_right, new_url, new_index = labeler.submit_judgment(
|
341 |
item_id, left_text, right_text, choice, session_id
|
342 |
)
|
343 |
-
url_html = f'<a href="{new_url}" target="_blank">{new_url}</a>' if new_url else ""
|
344 |
|
345 |
# Update session info text with new progress
|
346 |
progress_text = f"Session: {session_id} | {new_index + 1}/{len(labeler)}" if new_index < len(labeler) else f"Session: {session_id} | Complete! {len(labeler)}/{len(labeler)}"
|
347 |
|
348 |
-
return new_id, new_left, new_right,
|
349 |
else:
|
350 |
new_id, new_left, new_right, new_index = labeler.submit_judgment(
|
351 |
item_id, left_text, right_text, choice, session_id
|
|
|
200 |
|
201 |
# URL display component - only shown if URL column is defined
|
202 |
if labeler.has_url_column:
|
203 |
+
url_display = gr.Textbox(label="Reference URL", value="", visible=True, interactive=False)
|
204 |
|
205 |
# Main content area (shown with placeholder text)
|
206 |
with gr.Row():
|
|
|
248 |
# Get the initial data for this session ID
|
249 |
if labeler.has_url_column:
|
250 |
initial_id, initial_left, initial_right, initial_url = labeler.get_current_pair(session_id_value)
|
|
|
251 |
|
252 |
return (
|
253 |
session_id_value, # session_id state
|
254 |
True, # is_session_started state
|
255 |
labeler.current_index[session_id_value], # current_sample_sld
|
256 |
+
initial_url, # url_display (now just passing the URL directly)
|
257 |
initial_left, # left_output
|
258 |
initial_right, # right_output
|
259 |
initial_id, # item_id
|
|
|
339 |
new_id, new_left, new_right, new_url, new_index = labeler.submit_judgment(
|
340 |
item_id, left_text, right_text, choice, session_id
|
341 |
)
|
|
|
342 |
|
343 |
# Update session info text with new progress
|
344 |
progress_text = f"Session: {session_id} | {new_index + 1}/{len(labeler)}" if new_index < len(labeler) else f"Session: {session_id} | Complete! {len(labeler)}/{len(labeler)}"
|
345 |
|
346 |
+
return new_id, new_left, new_right, new_url, new_index, progress_text
|
347 |
else:
|
348 |
new_id, new_left, new_right, new_index = labeler.submit_judgment(
|
349 |
item_id, left_text, right_text, choice, session_id
|