Spaces:
Runtime error
Runtime error
polinaeterna
commited on
Commit
·
9962eae
1
Parent(s):
0d2fe93
logs
Browse files
app.py
CHANGED
|
@@ -186,7 +186,8 @@ def call_perspective_api(texts_df, column_name, nested_column_name, dataset, con
|
|
| 186 |
try:
|
| 187 |
req_response = session.post(PERSPECTIVE_URL, json=data, headers=headers)
|
| 188 |
except Exception as e:
|
| 189 |
-
|
|
|
|
| 190 |
return req_att_scores
|
| 191 |
|
| 192 |
if req_response.ok:
|
|
@@ -208,7 +209,6 @@ def call_perspective_api(texts_df, column_name, nested_column_name, dataset, con
|
|
| 208 |
return req_att_scores
|
| 209 |
if i % 10 == 0:
|
| 210 |
plot_toxicity(req_att_scores)
|
| 211 |
-
print(len(texts[:i]), len(req_att_scores["TOXICITY"]))
|
| 212 |
yield {"toxicity check in progress...": i / n_samples}, plt.gcf(), pd.DataFrame.from_dict({column_name: texts[:i+1], **req_att_scores})
|
| 213 |
|
| 214 |
plot_toxicity(req_att_scores)
|
|
|
|
| 186 |
try:
|
| 187 |
req_response = session.post(PERSPECTIVE_URL, json=data, headers=headers)
|
| 188 |
except Exception as e:
|
| 189 |
+
logging.info(e)
|
| 190 |
+
logging.info(data)
|
| 191 |
return req_att_scores
|
| 192 |
|
| 193 |
if req_response.ok:
|
|
|
|
| 209 |
return req_att_scores
|
| 210 |
if i % 10 == 0:
|
| 211 |
plot_toxicity(req_att_scores)
|
|
|
|
| 212 |
yield {"toxicity check in progress...": i / n_samples}, plt.gcf(), pd.DataFrame.from_dict({column_name: texts[:i+1], **req_att_scores})
|
| 213 |
|
| 214 |
plot_toxicity(req_att_scores)
|