Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ try:
|
|
| 21 |
spec.loader.exec_module(omniparser_module)
|
| 22 |
|
| 23 |
# 3. Get the OmniParser class from the successfully loaded module, with the correct casing.
|
| 24 |
-
OmniParser = omniparser_module.Omniparser
|
| 25 |
print("DEBUG: Successfully loaded Omniparser class using importlib.")
|
| 26 |
|
| 27 |
except Exception as e:
|
|
@@ -32,8 +32,9 @@ except Exception as e:
|
|
| 32 |
|
| 33 |
# --- The rest of the application ---
|
| 34 |
print("Initializing model...")
|
| 35 |
-
|
| 36 |
-
|
|
|
|
| 37 |
print("β
OmniParser model loaded successfully.")
|
| 38 |
|
| 39 |
def parse_document(input_file):
|
|
|
|
| 21 |
spec.loader.exec_module(omniparser_module)
|
| 22 |
|
| 23 |
# 3. Get the OmniParser class from the successfully loaded module, with the correct casing.
|
| 24 |
+
OmniParser = omniparser_module.Omniparser
|
| 25 |
print("DEBUG: Successfully loaded Omniparser class using importlib.")
|
| 26 |
|
| 27 |
except Exception as e:
|
|
|
|
| 32 |
|
| 33 |
# --- The rest of the application ---
|
| 34 |
print("Initializing model...")
|
| 35 |
+
|
| 36 |
+
# THIS IS THE FINAL FIX: Call the class constructor directly.
|
| 37 |
+
parser_instance = OmniParser(model_path="omniparser-v2-effnet")
|
| 38 |
print("β
OmniParser model loaded successfully.")
|
| 39 |
|
| 40 |
def parse_document(input_file):
|