Spaces:
Runtime error
Runtime error
Ruben Wolhandler
commited on
Commit
·
f49d541
1
Parent(s):
569de68
annotator update
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ if "annotator" not in state:
|
|
28 |
for idx, option in enumerate(OPTIONS):
|
29 |
c[idx].button(f"{option}", on_click=annotate, args=(option,))
|
30 |
|
31 |
-
if "annotations" not in state:
|
32 |
state.annotations = {}
|
33 |
state.annotations['data_id', 'index', 'output', 'model', 'is_faithfull'] = ''
|
34 |
f_0 = open(source_path)
|
@@ -66,8 +66,9 @@ def submit(index_0, index_1, index_2):
|
|
66 |
state.submit = 0
|
67 |
|
68 |
|
69 |
-
if state.files:
|
70 |
st.header("Dataset annotation")
|
|
|
71 |
selected_file = state.current_file
|
72 |
# source_file = selected_file[0]
|
73 |
# ori_file = selected_file[1]
|
@@ -80,6 +81,7 @@ if state.files:
|
|
80 |
state.indexes = [1, 2, 3]
|
81 |
random.shuffle(state.indexes)
|
82 |
|
|
|
83 |
st.write(f"Output: {selected_file[state.indexes[0]]}")
|
84 |
# c = st.columns(len(OPTIONS))
|
85 |
state.a = st.radio('a', OPTIONS, key=f'{0}')
|
|
|
28 |
for idx, option in enumerate(OPTIONS):
|
29 |
c[idx].button(f"{option}", on_click=annotate, args=(option,))
|
30 |
|
31 |
+
if "annotations" not in state and "annotator" in state:
|
32 |
state.annotations = {}
|
33 |
state.annotations['data_id', 'index', 'output', 'model', 'is_faithfull'] = ''
|
34 |
f_0 = open(source_path)
|
|
|
66 |
state.submit = 0
|
67 |
|
68 |
|
69 |
+
if state.files and "annotator" in state:
|
70 |
st.header("Dataset annotation")
|
71 |
+
st.header(state.annotator)
|
72 |
selected_file = state.current_file
|
73 |
# source_file = selected_file[0]
|
74 |
# ori_file = selected_file[1]
|
|
|
81 |
state.indexes = [1, 2, 3]
|
82 |
random.shuffle(state.indexes)
|
83 |
|
84 |
+
st.write('-'*50)
|
85 |
st.write(f"Output: {selected_file[state.indexes[0]]}")
|
86 |
# c = st.columns(len(OPTIONS))
|
87 |
state.a = st.radio('a', OPTIONS, key=f'{0}')
|