Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -181,13 +181,13 @@ class AIEvaluationForm:
|
|
181 |
return sources
|
182 |
|
183 |
def load_uploaded_json(file):
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
|
192 |
|
193 |
def generate_scorecard(self, *args) -> Tuple[Dict, str]:
|
|
|
181 |
return sources
|
182 |
|
183 |
def load_uploaded_json(file):
|
184 |
+
if file is None:
|
185 |
+
return {}
|
186 |
+
try:
|
187 |
+
with open(file.name, 'r') as f:
|
188 |
+
return json.load(f)
|
189 |
+
except Exception as e:
|
190 |
+
return {"error": str(e)}
|
191 |
|
192 |
|
193 |
def generate_scorecard(self, *args) -> Tuple[Dict, str]:
|