Spaces:
Running on Zero
Running on Zero
debug: add instrumentation to find crash location
Browse files
app.py
CHANGED
|
@@ -5,14 +5,21 @@ PaperProf — Main Gradio entry point.
|
|
| 5 |
import warnings
|
| 6 |
warnings.filterwarnings("ignore")
|
| 7 |
|
| 8 |
-
|
| 9 |
-
import
|
| 10 |
-
import
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
from core.
|
| 14 |
-
from core.
|
| 15 |
-
from core.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
CSS = """
|
| 18 |
/* Hide all Gradio chrome */
|
|
@@ -216,6 +223,7 @@ HEADER = """
|
|
| 216 |
# UI
|
| 217 |
# ---------------------------------------------------------------------------
|
| 218 |
|
|
|
|
| 219 |
with gr.Blocks(title="PaperProf", css=CSS) as demo:
|
| 220 |
|
| 221 |
gr.HTML(CUSTOM_HTML)
|
|
@@ -346,5 +354,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 346 |
outputs=[feedback_box, correct_state, total_state, score_box],
|
| 347 |
)
|
| 348 |
|
|
|
|
|
|
|
| 349 |
if __name__ == "__main__":
|
| 350 |
pass
|
|
|
|
| 5 |
import warnings
|
| 6 |
warnings.filterwarnings("ignore")
|
| 7 |
|
| 8 |
+
try:
|
| 9 |
+
import random
|
| 10 |
+
import pathlib
|
| 11 |
+
import gradio as gr
|
| 12 |
+
import spaces
|
| 13 |
+
from core.parser import extract_text
|
| 14 |
+
from core.chunker import chunk_text
|
| 15 |
+
from core.questioner import generate_question
|
| 16 |
+
from core.evaluator import evaluate_answer
|
| 17 |
+
print("✅ All imports successful")
|
| 18 |
+
except Exception as e:
|
| 19 |
+
import traceback
|
| 20 |
+
print(f"❌ Import error: {e}")
|
| 21 |
+
traceback.print_exc()
|
| 22 |
+
raise
|
| 23 |
|
| 24 |
CSS = """
|
| 25 |
/* Hide all Gradio chrome */
|
|
|
|
| 223 |
# UI
|
| 224 |
# ---------------------------------------------------------------------------
|
| 225 |
|
| 226 |
+
print("✅ Starting Gradio app...")
|
| 227 |
with gr.Blocks(title="PaperProf", css=CSS) as demo:
|
| 228 |
|
| 229 |
gr.HTML(CUSTOM_HTML)
|
|
|
|
| 354 |
outputs=[feedback_box, correct_state, total_state, score_box],
|
| 355 |
)
|
| 356 |
|
| 357 |
+
print("✅ Gradio demo defined successfully")
|
| 358 |
+
|
| 359 |
if __name__ == "__main__":
|
| 360 |
pass
|