AvocadoMuffin commited on
Commit
69be4eb
·
verified ·
1 Parent(s): a1ce4b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
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
- dataset = load_dataset("cuad", trust_remote_code=True, token=hf_token)
 
94
  test_data = dataset["test"]
 
95
  except Exception as e:
96
  try:
97
- dataset = load_dataset("theatticusproject/cuad", trust_remote_code=True, token=hf_token)
98
- test_data = dataset["test"]
 
 
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