Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -88,14 +88,18 @@ def run_evaluation(num_samples, progress=gr.Progress()):
|
|
88 |
|
89 |
progress(0.1, desc="Loading CUAD dataset...")
|
90 |
|
91 |
-
# Load dataset
|
92 |
try:
|
93 |
-
|
|
|
94 |
test_data = dataset["test"]
|
|
|
95 |
except Exception as e:
|
96 |
try:
|
97 |
-
|
98 |
-
|
|
|
|
|
99 |
except Exception as e2:
|
100 |
return f"❌ Error loading dataset: {e2}", pd.DataFrame(), None
|
101 |
|
|
|
88 |
|
89 |
progress(0.1, desc="Loading CUAD dataset...")
|
90 |
|
91 |
+
# Load dataset - use QA format version (JSON, no PDFs)
|
92 |
try:
|
93 |
+
# Try the QA-specific version first (much faster, JSON format)
|
94 |
+
dataset = load_dataset("theatticusproject/cuad-qa", trust_remote_code=True, token=hf_token)
|
95 |
test_data = dataset["test"]
|
96 |
+
print(f"✓ Loaded CUAD-QA dataset with {len(test_data)} samples")
|
97 |
except Exception as e:
|
98 |
try:
|
99 |
+
# Fallback to original but limit to avoid PDF downloads
|
100 |
+
dataset = load_dataset("cuad", split="test[:1000]", trust_remote_code=True, token=hf_token)
|
101 |
+
test_data = dataset
|
102 |
+
print(f"✓ Loaded CUAD dataset with {len(test_data)} samples")
|
103 |
except Exception as e2:
|
104 |
return f"❌ Error loading dataset: {e2}", pd.DataFrame(), None
|
105 |
|