Spaces:
Sleeping
Sleeping
record result update
Browse files
app.py
CHANGED
@@ -14,11 +14,19 @@ task_completed = 0
|
|
14 |
task_completed_steps = None
|
15 |
|
16 |
|
17 |
-
def is_task_incomplete(example
|
18 |
return example["task_completed"] is None and example["task_completed_steps"] is None
|
19 |
|
20 |
|
21 |
-
def is_task_given_up(example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
return example["task_completed"] == 0 and example["task_completed_steps"] == 0
|
23 |
|
24 |
|
@@ -110,7 +118,7 @@ def chat(user_input, history):
|
|
110 |
human_result_url = "jjz5463/simulator_human_result"
|
111 |
app_name = simulator_app.app_name
|
112 |
synthetic_tasks = load_dataset(human_result_url, app_name, split='train')
|
113 |
-
incomplete_tasks = synthetic_tasks.filter(
|
114 |
if len(incomplete_tasks) > 0:
|
115 |
incomplete_task_index = incomplete_tasks['__index_level_0__'][0]
|
116 |
synthetic_tasks = synthetic_tasks.map(
|
@@ -142,7 +150,7 @@ def give_up():
|
|
142 |
synthetic_tasks = load_dataset(human_result_url, app_name, split='train')
|
143 |
|
144 |
# Find the first incomplete task
|
145 |
-
incomplete_tasks = synthetic_tasks.filter(
|
146 |
if len(incomplete_tasks) > 0:
|
147 |
incomplete_task_index = incomplete_tasks['__index_level_0__'][0]
|
148 |
|
|
|
14 |
task_completed_steps = None
|
15 |
|
16 |
|
17 |
+
def is_task_incomplete(example):
|
18 |
return example["task_completed"] is None and example["task_completed_steps"] is None
|
19 |
|
20 |
|
21 |
+
def is_task_given_up(example):
|
22 |
+
return example["task_completed"] == 0 and example["task_completed_steps"] == 0
|
23 |
+
|
24 |
+
|
25 |
+
def is_task_incomplete_idx(example, idx):
|
26 |
+
return example["task_completed"] is None and example["task_completed_steps"] is None
|
27 |
+
|
28 |
+
|
29 |
+
def is_task_given_up_idx(example, idx):
|
30 |
return example["task_completed"] == 0 and example["task_completed_steps"] == 0
|
31 |
|
32 |
|
|
|
118 |
human_result_url = "jjz5463/simulator_human_result"
|
119 |
app_name = simulator_app.app_name
|
120 |
synthetic_tasks = load_dataset(human_result_url, app_name, split='train')
|
121 |
+
incomplete_tasks = synthetic_tasks.filter(is_task_incomplete_idx, with_indices=True,)
|
122 |
if len(incomplete_tasks) > 0:
|
123 |
incomplete_task_index = incomplete_tasks['__index_level_0__'][0]
|
124 |
synthetic_tasks = synthetic_tasks.map(
|
|
|
150 |
synthetic_tasks = load_dataset(human_result_url, app_name, split='train')
|
151 |
|
152 |
# Find the first incomplete task
|
153 |
+
incomplete_tasks = synthetic_tasks.filter(is_task_incomplete_idx, with_indices=True,)
|
154 |
if len(incomplete_tasks) > 0:
|
155 |
incomplete_task_index = incomplete_tasks['__index_level_0__'][0]
|
156 |
|