Spaces:
Running
Running
fix: dealing with null value
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import sys
|
|
|
3 |
import requests
|
4 |
import gradio as gr
|
5 |
import pandas as pd
|
@@ -127,6 +128,12 @@ def RAG_evaluation(uploaded_file, user_api_key):
|
|
127 |
"Context Entity Recall": getattr(row, "context_entity_recall", None),
|
128 |
# "Noise Sensitivity": getattr(row, "noise_sensitivity_relevant", None)
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
records.append(record)
|
131 |
|
132 |
log_to_google_sheet(
|
|
|
1 |
import os
|
2 |
import sys
|
3 |
+
import math
|
4 |
import requests
|
5 |
import gradio as gr
|
6 |
import pandas as pd
|
|
|
128 |
"Context Entity Recall": getattr(row, "context_entity_recall", None),
|
129 |
# "Noise Sensitivity": getattr(row, "noise_sensitivity_relevant", None)
|
130 |
}
|
131 |
+
|
132 |
+
for key in list(record.keys()):
|
133 |
+
val = record[key]
|
134 |
+
if isinstance(val, float) and not math.isfinite(val):
|
135 |
+
record[key] = ""
|
136 |
+
|
137 |
records.append(record)
|
138 |
|
139 |
log_to_google_sheet(
|