ahmetyaylalioglu commited on
Commit
8594f35
1 Parent(s): e0d84c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -24,12 +24,18 @@ pipeline = DiffusionPipeline.from_pretrained(
24
  @spaces.GPU
25
  def run(image):
26
  input_image = np.array(image, dtype=np.float32) / 255.0
27
- splat = pipeline(
28
- "", input_image, guidance_scale=5, num_inference_steps=30, elevation=0
29
- )
30
- splat_file = "/tmp/output.ply"
31
- #pipeline.save_ply(splat, splat_file)
32
- return splat_file
 
 
 
 
 
 
33
 
34
 
35
  demo = gr.Interface(
 
24
  @spaces.GPU
25
  def run(image):
26
  input_image = np.array(image, dtype=np.float32) / 255.0
27
+ try:
28
+ splat = pipeline("", input_image, guidance_scale=5, num_inference_steps=30, elevation=0)
29
+ splat_file = "/tmp/output.ply"
30
+ # Assuming `save_ply` is a function you defined to handle .ply files.
31
+ save_ply(splat, splat_file)
32
+ return splat_file
33
+ except AttributeError as e:
34
+ return f"Failed to save file due to an attribute error: {str(e)}"
35
+ except Exception as e:
36
+ return f"An error occurred: {str(e)}"
37
+
38
+
39
 
40
 
41
  demo = gr.Interface(