Spaces:
Running
Running
logs
Browse files
app.py
CHANGED
@@ -2,10 +2,13 @@ import asyncio
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
|
|
5 |
|
6 |
from data_access import get_questions, get_source_finders, get_run_ids, get_baseline_rankers, \
|
7 |
get_unified_sources
|
8 |
|
|
|
|
|
9 |
# Initialize data at the module level
|
10 |
questions = []
|
11 |
source_finders = []
|
@@ -48,8 +51,9 @@ async def initialize_data():
|
|
48 |
|
49 |
def update_sources_list(question_option, source_finder_id, run_id: str, baseline_ranker_id: str, evt: gr.EventData = None):
|
50 |
global previous_run_id
|
51 |
-
if evt
|
52 |
-
|
|
|
53 |
return gr.skip(), gr.skip(), gr.skip(), gr.skip()
|
54 |
|
55 |
previous_run_id = run_id
|
@@ -218,4 +222,5 @@ async def main():
|
|
218 |
|
219 |
|
220 |
if __name__ == "__main__":
|
|
|
221 |
asyncio.run(main())
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
5 |
+
import logging
|
6 |
|
7 |
from data_access import get_questions, get_source_finders, get_run_ids, get_baseline_rankers, \
|
8 |
get_unified_sources
|
9 |
|
10 |
+
logger = logging.getLogger(__name__)
|
11 |
+
|
12 |
# Initialize data at the module level
|
13 |
questions = []
|
14 |
source_finders = []
|
|
|
51 |
|
52 |
def update_sources_list(question_option, source_finder_id, run_id: str, baseline_ranker_id: str, evt: gr.EventData = None):
|
53 |
global previous_run_id
|
54 |
+
if evt:
|
55 |
+
logger.info(f"event: {evt.target.elem_id}")
|
56 |
+
if evt.target.elem_id == "run_id_dropdown" and (type(run_id) == list or run_id == previous_run_id):
|
57 |
return gr.skip(), gr.skip(), gr.skip(), gr.skip()
|
58 |
|
59 |
previous_run_id = run_id
|
|
|
222 |
|
223 |
|
224 |
if __name__ == "__main__":
|
225 |
+
logging.basicConfig(level=logging.INFO)
|
226 |
asyncio.run(main())
|