Spaces:
Sleeping
Sleeping
Commit ·
6018992
1
Parent(s): 4ed5b73
Fix HuggingFace Spaces launch and args type check
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def main():
|
|
| 45 |
logger.info("UI built successfully!")
|
| 46 |
|
| 47 |
logger.info("Launching application...")
|
| 48 |
-
app.launch()
|
| 49 |
logger.info("Application started!")
|
| 50 |
|
| 51 |
|
|
|
|
| 45 |
logger.info("UI built successfully!")
|
| 46 |
|
| 47 |
logger.info("Launching application...")
|
| 48 |
+
app.launch(server_name="0.0.0.0", server_port=7860, share=False)
|
| 49 |
logger.info("Application started!")
|
| 50 |
|
| 51 |
|
model.py
CHANGED
|
@@ -34,9 +34,9 @@ def initialize(model_path: str, device: str) -> torch.nn.Module:
|
|
| 34 |
logger.info("Parsing model arguments...")
|
| 35 |
args = ckpt['args'].model.replace("ManyAR_PatchEmbed", "PatchEmbedDust3R")
|
| 36 |
|
| 37 |
-
if 'landscape_only' not in args:
|
| 38 |
args = args[:-1] + ', landscape_only=False)'
|
| 39 |
-
|
| 40 |
args = args.replace(" ", "").replace('landscape_only=True', 'landscape_only=False')
|
| 41 |
|
| 42 |
logger.info("Instantiating model...")
|
|
|
|
| 34 |
logger.info("Parsing model arguments...")
|
| 35 |
args = ckpt['args'].model.replace("ManyAR_PatchEmbed", "PatchEmbedDust3R")
|
| 36 |
|
| 37 |
+
if isinstance(args, str) and 'landscape_only' not in args:
|
| 38 |
args = args[:-1] + ', landscape_only=False)'
|
| 39 |
+
elif isinstance(args, str):
|
| 40 |
args = args.replace(" ", "").replace('landscape_only=True', 'landscape_only=False')
|
| 41 |
|
| 42 |
logger.info("Instantiating model...")
|