huytofu92 commited on
Commit
7021ba9
·
1 Parent(s): bbb57a0

Fix scripts and print results

Browse files
Files changed (2) hide show
  1. app.py +10 -7
  2. 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 install --assume-yes --no-install-recommends libasound2
5
- apt-get install --assume-yes --no-install-recommends libatk-bridge2.0-0
6
- apt-get install --assume-yes --no-install-recommends libatk1.0-0
7
- apt-get install --assume-yes --no-install-recommends libatspi2.0-0
8
- apt-get install --assume-yes --no-install-recommends libcairo2
9
- apt-get install --assume-yes --no-install-recommends libcups2
10
- apt-get install --assume-yes --no-install-recommends libdbus-1-3
11
- apt-get install --assume-yes --no-install-recommends libdrm2
12
- apt-get install --assume-yes --no-install-recommends libgbm1
13
- apt-get install --assume-yes --no-install-recommends libglib2.0-0
14
- apt-get install --assume-yes --no-install-recommends libnspr4
15
- apt-get install --assume-yes --no-install-recommends libnss3
16
- apt-get install --assume-yes --no-install-recommends libpango-1.0-0
17
- apt-get install --assume-yes --no-install-recommends libx11-6
18
- apt-get install --assume-yes --no-install-recommends libxcb1
19
- apt-get install --assume-yes --no-install-recommends libxcomposite1
20
- apt-get install --assume-yes --no-install-recommends libxdamage1
21
 
22
- apt-get install --assume-yes --no-install-recommends libxext6
23
- apt-get install --assume-yes --no-install-recommends libxfixes3
24
- apt-get install --assume-yes --no-install-recommends libxkbcommon0
25
- apt-get install --assume-yes --no-install-recommends libxrandr2
26
- apt-get install --assume-yes --no-install-recommends libcairo-gobject2
27
- apt-get install --assume-yes --no-install-recommends libdbus-glib-1-2
28
- apt-get install --assume-yes --no-install-recommends libfontconfig1
29
- apt-get install --assume-yes --no-install-recommends libgdk-pixbuf-2.0-0
30
- apt-get install --assume-yes --no-install-recommends libgtk-3-0
31
- apt-get install --assume-yes --no-install-recommends libharfbuzz0b
32
- apt-get install --assume-yes --no-install-recommends libpangocairo-1.0-0
33
- apt-get install --assume-yes --no-install-recommends libx11-xcb1
34
- apt-get install --assume-yes --no-install-recommends libxcb-shm0
35
- apt-get install --assume-yes --no-install-recommends libxcursor1
36
- apt-get install --assume-yes --no-install-recommends libxi6
37
- apt-get install --assume-yes --no-install-recommends libxrender1
38
- apt-get install --assume-yes --no-install-recommends libxtst6
39
- apt-get install --assume-yes --no-install-recommends libsoup-3.0-0
40
- apt-get install --assume-yes --no-install-recommends gstreamer1.0-libav
41
- apt-get install --assume-yes --no-install-recommends gstreamer1.0-plugins-bad
42
- apt-get install --assume-yes --no-install-recommends gstreamer1.0-plugins-base
43
- apt-get install --assume-yes --no-install-recommends gstreamer1.0-plugins-good
44
- apt-get install --assume-yes --no-install-recommends libegl1
45
- apt-get install --assume-yes --no-install-recommends libenchant-2-2
46
- apt-get install --assume-yes --no-install-recommends libepoxy0
47
- apt-get install --assume-yes --no-install-recommends libevdev2
48
- apt-get install --assume-yes --no-install-recommends libgles2
49
 
50
  # Additional dependencies from playwright install-deps --dry-run
51
- apt-get --assume-yes install libglx0
52
- apt-get --assume-yes install libgstreamer-gl1.0-0
53
- apt-get --assume-yes install libgstreamer-plugins-base1.0-0
54
- apt-get --assume-yes install libgstreamer1.0-0
55
- apt-get --assume-yes install libgtk-4-1
56
- apt-get --assume-yes install libgudev-1.0-0
57
- apt-get --assume-yes install libharfbuzz-icu0
58
- apt-get --assume-yes install libhyphen0
59
- apt-get --assume-yes install libicu72
60
- apt-get --assume-yes install libjpeg62-turbo
61
- apt-get --assume-yes install liblcms2-2
62
- apt-get --assume-yes install libmanette-0.2-0
63
- apt-get --assume-yes install libnotify4
64
- apt-get --assume-yes install libopengl0
65
- apt-get --assume-yes install libopenjp2-7
66
- apt-get --assume-yes install libopus0
67
- apt-get --assume-yes install libpng16-16
68
- apt-get --assume-yes install libproxy1v5
69
- apt-get --assume-yes install libsecret-1-0
70
- apt-get --assume-yes install libwayland-client0
71
- apt-get --assume-yes install libwayland-egl1
72
- apt-get --assume-yes install libwayland-server0
73
- apt-get --assume-yes install libwebp7
74
- apt-get --assume-yes install libwebpdemux2
75
- apt-get --assume-yes install libwoff1
76
- apt-get --assume-yes install libxml2
77
- apt-get --assume-yes install libxslt1.1
78
- apt-get --assume-yes install libatomic1
79
- apt-get --assume-yes install libevent-2.1-7
80
- apt-get --assume-yes install libavif15
81
- apt-get --assume-yes install xvfb
82
- apt-get --assume-yes install fonts-noto-color-emoji
83
- apt-get --assume-yes install fonts-unifont
84
- apt-get --assume-yes install xfonts-scalable
85
- apt-get --assume-yes install fonts-liberation
86
- apt-get --assume-yes install fonts-ipafont-gothic
87
- apt-get --assume-yes install fonts-wqy-zenhei
88
- apt-get --assume-yes install fonts-tlwg-loma-otf
89
- apt-get --assume-yes install fonts-freefont-ttf
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