Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -159,10 +159,16 @@ print(os.listdir('.'))
|
|
| 159 |
# ==============================
|
| 160 |
# PIPELINE IMPORT
|
| 161 |
# ==============================
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
try:
|
| 163 |
from working_yolo_pipeline import run_document_pipeline, DEFAULT_LAYOUTLMV3_MODEL_PATH, WEIGHTS_PATH
|
| 164 |
-
except
|
| 165 |
-
print("Warning:
|
|
|
|
|
|
|
| 166 |
def run_document_pipeline(*args):
|
| 167 |
return {"error": "Placeholder pipeline function called."}
|
| 168 |
DEFAULT_LAYOUTLMV3_MODEL_PATH = "./models/layoutlmv3_model"
|
|
|
|
| 159 |
# ==============================
|
| 160 |
# PIPELINE IMPORT
|
| 161 |
# ==============================
|
| 162 |
+
# try:
|
| 163 |
+
# from working_yolo_pipeline import run_document_pipeline, DEFAULT_LAYOUTLMV3_MODEL_PATH, WEIGHTS_PATH
|
| 164 |
+
# except ImportError:
|
| 165 |
+
# print("Warning: 'working_yolo_pipeline.py' not found. Using dummy paths.")
|
| 166 |
try:
|
| 167 |
from working_yolo_pipeline import run_document_pipeline, DEFAULT_LAYOUTLMV3_MODEL_PATH, WEIGHTS_PATH
|
| 168 |
+
except Exception as e: # Catch ALL exceptions
|
| 169 |
+
print(f"Warning: Failed to import pipeline: {e}")
|
| 170 |
+
import traceback
|
| 171 |
+
traceback.print_exc() # Show the actual error
|
| 172 |
def run_document_pipeline(*args):
|
| 173 |
return {"error": "Placeholder pipeline function called."}
|
| 174 |
DEFAULT_LAYOUTLMV3_MODEL_PATH = "./models/layoutlmv3_model"
|