Spaces:
Build error
Build error
Manik Sheokand commited on
Commit ·
e218c05
1
Parent(s): 43a0abb
Fix: Remove unsupported launch params, fix model loading with ignore_mismatched_sizes, and ensure Gradio 4.44.1
Browse files
app.py
CHANGED
|
@@ -25,9 +25,11 @@ def load_model():
|
|
| 25 |
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
|
| 26 |
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
| 27 |
model_name,
|
| 28 |
-
|
| 29 |
device_map="auto",
|
| 30 |
-
trust_remote_code=True
|
|
|
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
logger.info("Model loaded successfully!")
|
|
@@ -225,9 +227,7 @@ def main():
|
|
| 225 |
server_name="0.0.0.0",
|
| 226 |
server_port=7860,
|
| 227 |
share=False,
|
| 228 |
-
show_error=True
|
| 229 |
-
enable_queue=True,
|
| 230 |
-
max_threads=10
|
| 231 |
)
|
| 232 |
except Exception as e:
|
| 233 |
logger.error(f"Error launching app: {e}")
|
|
|
|
| 25 |
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
|
| 26 |
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
| 27 |
model_name,
|
| 28 |
+
dtype=torch.bfloat16,
|
| 29 |
device_map="auto",
|
| 30 |
+
trust_remote_code=True,
|
| 31 |
+
low_cpu_mem_usage=True,
|
| 32 |
+
ignore_mismatched_sizes=True
|
| 33 |
)
|
| 34 |
|
| 35 |
logger.info("Model loaded successfully!")
|
|
|
|
| 227 |
server_name="0.0.0.0",
|
| 228 |
server_port=7860,
|
| 229 |
share=False,
|
| 230 |
+
show_error=True
|
|
|
|
|
|
|
| 231 |
)
|
| 232 |
except Exception as e:
|
| 233 |
logger.error(f"Error launching app: {e}")
|