Update model.py
Browse files
model.py
CHANGED
|
@@ -7,10 +7,14 @@ from io import BytesIO
|
|
| 7 |
|
| 8 |
def load_pipeline():
|
| 9 |
"""
|
| 10 |
-
Load the
|
| 11 |
"""
|
| 12 |
ckpt_id = "dylanebert/LGM-full"
|
| 13 |
-
pipe = DiffusionPipeline.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
return pipe
|
| 15 |
|
| 16 |
def generate_3d_model(pipe, prompt, output_path="output.obj", guidance_scale=7.5, num_inference_steps=32):
|
|
|
|
| 7 |
|
| 8 |
def load_pipeline():
|
| 9 |
"""
|
| 10 |
+
Load the LGM-full model pipeline from Hugging Face with remote code execution enabled.
|
| 11 |
"""
|
| 12 |
ckpt_id = "dylanebert/LGM-full"
|
| 13 |
+
pipe = DiffusionPipeline.from_pretrained(
|
| 14 |
+
ckpt_id,
|
| 15 |
+
torch_dtype=torch.float32,
|
| 16 |
+
trust_remote_code=True # Enable remote code execution for custom model code
|
| 17 |
+
).to("cpu")
|
| 18 |
return pipe
|
| 19 |
|
| 20 |
def generate_3d_model(pipe, prompt, output_path="output.obj", guidance_scale=7.5, num_inference_steps=32):
|