Spaces:
Sleeping
Sleeping
Fix scripts and print results
Browse files- app.py +10 -7
- scripts.sh +83 -83
app.py
CHANGED
@@ -87,8 +87,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None, mock_submission: bool =
|
|
87 |
continue
|
88 |
if "youtube" in question_text.lower() and "bird" in question_text.lower():
|
89 |
continue
|
90 |
-
# if "chess" not in question_text.lower():
|
91 |
-
# continue
|
92 |
try:
|
93 |
if file_path:
|
94 |
question_text = question_text + f"\n\nHere is also the path to the file for the task (file name matches with task ID and is not in plain English): {file_path}"
|
@@ -127,7 +125,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None, mock_submission: bool =
|
|
127 |
f"Message: {result_data.get('message', 'No message received.')}"
|
128 |
)
|
129 |
print("Submission successful.")
|
130 |
-
results_df = pd.DataFrame(results_log)
|
|
|
131 |
return final_status, results_df
|
132 |
except requests.exceptions.HTTPError as e:
|
133 |
error_detail = f"Server responded with status {e.response.status_code}."
|
@@ -138,22 +137,26 @@ def run_and_submit_all( profile: gr.OAuthProfile | None, mock_submission: bool =
|
|
138 |
error_detail += f" Response: {e.response.text[:500]}"
|
139 |
status_message = f"Submission Failed: {error_detail}"
|
140 |
print(status_message)
|
141 |
-
results_df = pd.DataFrame(results_log)
|
|
|
142 |
return status_message, results_df
|
143 |
except requests.exceptions.Timeout:
|
144 |
status_message = "Submission Failed: The request timed out."
|
145 |
print(status_message)
|
146 |
-
results_df = pd.DataFrame(results_log)
|
|
|
147 |
return status_message, results_df
|
148 |
except requests.exceptions.RequestException as e:
|
149 |
status_message = f"Submission Failed: Network error - {e}"
|
150 |
print(status_message)
|
151 |
-
results_df = pd.DataFrame(results_log)
|
|
|
152 |
return status_message, results_df
|
153 |
except Exception as e:
|
154 |
status_message = f"An unexpected error occurred during submission: {e}"
|
155 |
print(status_message)
|
156 |
-
results_df = pd.DataFrame(results_log)
|
|
|
157 |
return status_message, results_df
|
158 |
|
159 |
|
|
|
87 |
continue
|
88 |
if "youtube" in question_text.lower() and "bird" in question_text.lower():
|
89 |
continue
|
|
|
|
|
90 |
try:
|
91 |
if file_path:
|
92 |
question_text = question_text + f"\n\nHere is also the path to the file for the task (file name matches with task ID and is not in plain English): {file_path}"
|
|
|
125 |
f"Message: {result_data.get('message', 'No message received.')}"
|
126 |
)
|
127 |
print("Submission successful.")
|
128 |
+
results_df = pd.DataFrame(results_log, columns=["Task ID", "Question", "Submitted Answer"])
|
129 |
+
print(results_df["Task ID", "Submitted Answer"].head(20))
|
130 |
return final_status, results_df
|
131 |
except requests.exceptions.HTTPError as e:
|
132 |
error_detail = f"Server responded with status {e.response.status_code}."
|
|
|
137 |
error_detail += f" Response: {e.response.text[:500]}"
|
138 |
status_message = f"Submission Failed: {error_detail}"
|
139 |
print(status_message)
|
140 |
+
results_df = pd.DataFrame(results_log, columns=["Task ID", "Question", "Submitted Answer"])
|
141 |
+
print(results_df["Task ID", "Submitted Answer"].head(20))
|
142 |
return status_message, results_df
|
143 |
except requests.exceptions.Timeout:
|
144 |
status_message = "Submission Failed: The request timed out."
|
145 |
print(status_message)
|
146 |
+
results_df = pd.DataFrame(results_log, columns=["Task ID", "Question", "Submitted Answer"])
|
147 |
+
print(results_df["Task ID", "Submitted Answer"].head(20))
|
148 |
return status_message, results_df
|
149 |
except requests.exceptions.RequestException as e:
|
150 |
status_message = f"Submission Failed: Network error - {e}"
|
151 |
print(status_message)
|
152 |
+
results_df = pd.DataFrame(results_log, columns=["Task ID", "Question", "Submitted Answer"])
|
153 |
+
print(results_df["Task ID", "Submitted Answer"].head(20))
|
154 |
return status_message, results_df
|
155 |
except Exception as e:
|
156 |
status_message = f"An unexpected error occurred during submission: {e}"
|
157 |
print(status_message)
|
158 |
+
results_df = pd.DataFrame(results_log, columns=["Task ID", "Question", "Submitted Answer"])
|
159 |
+
print(results_df["Task ID", "Submitted Answer"].head(20))
|
160 |
return status_message, results_df
|
161 |
|
162 |
|
scripts.sh
CHANGED
@@ -1,90 +1,90 @@
|
|
1 |
playwright install
|
2 |
|
3 |
apt-get update
|
4 |
-
apt-get
|
5 |
-
apt-get
|
6 |
-
apt-get
|
7 |
-
apt-get
|
8 |
-
apt-get
|
9 |
-
apt-get
|
10 |
-
apt-get
|
11 |
-
apt-get
|
12 |
-
apt-get
|
13 |
-
apt-get
|
14 |
-
apt-get
|
15 |
-
apt-get
|
16 |
-
apt-get
|
17 |
-
apt-get
|
18 |
-
apt-get
|
19 |
-
apt-get
|
20 |
-
apt-get
|
21 |
|
22 |
-
apt-get
|
23 |
-
apt-get
|
24 |
-
apt-get
|
25 |
-
apt-get
|
26 |
-
apt-get
|
27 |
-
apt-get
|
28 |
-
apt-get
|
29 |
-
apt-get
|
30 |
-
apt-get
|
31 |
-
apt-get
|
32 |
-
apt-get
|
33 |
-
apt-get
|
34 |
-
apt-get
|
35 |
-
apt-get
|
36 |
-
apt-get
|
37 |
-
apt-get
|
38 |
-
apt-get
|
39 |
-
apt-get
|
40 |
-
apt-get
|
41 |
-
apt-get
|
42 |
-
apt-get
|
43 |
-
apt-get
|
44 |
-
apt-get
|
45 |
-
apt-get
|
46 |
-
apt-get
|
47 |
-
apt-get
|
48 |
-
apt-get
|
49 |
|
50 |
# Additional dependencies from playwright install-deps --dry-run
|
51 |
-
apt-get
|
52 |
-
apt-get
|
53 |
-
apt-get
|
54 |
-
apt-get
|
55 |
-
apt-get
|
56 |
-
apt-get
|
57 |
-
apt-get
|
58 |
-
apt-get
|
59 |
-
apt-get
|
60 |
-
apt-get
|
61 |
-
apt-get
|
62 |
-
apt-get
|
63 |
-
apt-get
|
64 |
-
apt-get
|
65 |
-
apt-get
|
66 |
-
apt-get
|
67 |
-
apt-get
|
68 |
-
apt-get
|
69 |
-
apt-get
|
70 |
-
apt-get
|
71 |
-
apt-get
|
72 |
-
apt-get
|
73 |
-
apt-get
|
74 |
-
apt-get
|
75 |
-
apt-get
|
76 |
-
apt-get
|
77 |
-
apt-get
|
78 |
-
apt-get
|
79 |
-
apt-get
|
80 |
-
apt-get
|
81 |
-
apt-get
|
82 |
-
apt-get
|
83 |
-
apt-get
|
84 |
-
apt-get
|
85 |
-
apt-get
|
86 |
-
apt-get
|
87 |
-
apt-get
|
88 |
-
apt-get
|
89 |
-
apt-get
|
90 |
|
|
|
1 |
playwright install
|
2 |
|
3 |
apt-get update
|
4 |
+
apt-get -y install libasound2
|
5 |
+
apt-get -y install libatk-bridge2.0-0
|
6 |
+
apt-get -y install libatk1.0-0
|
7 |
+
apt-get -y install libatspi2.0-0
|
8 |
+
apt-get -y install libcairo2
|
9 |
+
apt-get -y install libcups2
|
10 |
+
apt-get -y install libdbus-1-3
|
11 |
+
apt-get -y install libdrm2
|
12 |
+
apt-get -y install libgbm1
|
13 |
+
apt-get -y install libglib2.0-0
|
14 |
+
apt-get -y install libnspr4
|
15 |
+
apt-get -y install libnss3
|
16 |
+
apt-get -y install libpango-1.0-0
|
17 |
+
apt-get -y install libx11-6
|
18 |
+
apt-get -y install libxcb1
|
19 |
+
apt-get -y install libxcomposite1
|
20 |
+
apt-get -y install libxdamage1
|
21 |
|
22 |
+
apt-get -y install libxext6
|
23 |
+
apt-get -y install libxfixes3
|
24 |
+
apt-get -y install libxkbcommon0
|
25 |
+
apt-get -y install libxrandr2
|
26 |
+
apt-get -y install libcairo-gobject2
|
27 |
+
apt-get -y install libdbus-glib-1-2
|
28 |
+
apt-get -y install libfontconfig1
|
29 |
+
apt-get -y install libgdk-pixbuf-2.0-0
|
30 |
+
apt-get -y install libgtk-3-0
|
31 |
+
apt-get -y install libharfbuzz0b
|
32 |
+
apt-get -y install libpangocairo-1.0-0
|
33 |
+
apt-get -y install libx11-xcb1
|
34 |
+
apt-get -y install libxcb-shm0
|
35 |
+
apt-get -y install libxcursor1
|
36 |
+
apt-get -y install libxi6
|
37 |
+
apt-get -y install libxrender1
|
38 |
+
apt-get -y install libxtst6
|
39 |
+
apt-get -y install libsoup-3.0-0
|
40 |
+
apt-get -y install gstreamer1.0-libav
|
41 |
+
apt-get -y install gstreamer1.0-plugins-bad
|
42 |
+
apt-get -y install gstreamer1.0-plugins-base
|
43 |
+
apt-get -y install gstreamer1.0-plugins-good
|
44 |
+
apt-get -y install libegl1
|
45 |
+
apt-get -y install libenchant-2-2
|
46 |
+
apt-get -y install libepoxy0
|
47 |
+
apt-get -y install libevdev2
|
48 |
+
apt-get -y install libgles2
|
49 |
|
50 |
# Additional dependencies from playwright install-deps --dry-run
|
51 |
+
apt-get -y install libglx0
|
52 |
+
apt-get -y install libgstreamer-gl1.0-0
|
53 |
+
apt-get -y install libgstreamer-plugins-base1.0-0
|
54 |
+
apt-get -y install libgstreamer1.0-0
|
55 |
+
apt-get -y install libgtk-4-1
|
56 |
+
apt-get -y install libgudev-1.0-0
|
57 |
+
apt-get -y install libharfbuzz-icu0
|
58 |
+
apt-get -y install libhyphen0
|
59 |
+
apt-get -y install libicu72
|
60 |
+
apt-get -y install libjpeg62-turbo
|
61 |
+
apt-get -y install liblcms2-2
|
62 |
+
apt-get -y install libmanette-0.2-0
|
63 |
+
apt-get -y install libnotify4
|
64 |
+
apt-get -y install libopengl0
|
65 |
+
apt-get -y install libopenjp2-7
|
66 |
+
apt-get -y install libopus0
|
67 |
+
apt-get -y install libpng16-16
|
68 |
+
apt-get -y install libproxy1v5
|
69 |
+
apt-get -y install libsecret-1-0
|
70 |
+
apt-get -y install libwayland-client0
|
71 |
+
apt-get -y install libwayland-egl1
|
72 |
+
apt-get -y install libwayland-server0
|
73 |
+
apt-get -y install libwebp7
|
74 |
+
apt-get -y install libwebpdemux2
|
75 |
+
apt-get -y install libwoff1
|
76 |
+
apt-get -y install libxml2
|
77 |
+
apt-get -y install libxslt1.1
|
78 |
+
apt-get -y install libatomic1
|
79 |
+
apt-get -y install libevent-2.1-7
|
80 |
+
apt-get -y install libavif15
|
81 |
+
apt-get -y install xvfb
|
82 |
+
apt-get -y install fonts-noto-color-emoji
|
83 |
+
apt-get -y install fonts-unifont
|
84 |
+
apt-get -y install xfonts-scalable
|
85 |
+
apt-get -y install fonts-liberation
|
86 |
+
apt-get -y install fonts-ipafont-gothic
|
87 |
+
apt-get -y install fonts-wqy-zenhei
|
88 |
+
apt-get -y install fonts-tlwg-loma-otf
|
89 |
+
apt-get -y install fonts-freefont-ttf
|
90 |
|