Zanflip commited on
Commit
f3d5c36
·
verified ·
1 Parent(s): 19772be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import import gradio as gr
2
  import replicate
3
  import requests
4
  import os
@@ -11,11 +11,13 @@ def generate_3d(prompt):
11
  try:
12
  output = replicate.run(
13
  "openai/shap-e:9c9ecb8d35d0cc0ecde68b8a0d4a2f94f2bc6ee9393e8c3d76c44d7c0d75b1f9",
14
- input={"prompt": prompt, "guidance_scale": 15, "num_inference_steps": 64}
 
 
 
 
15
  )
16
 
17
- print("REPLICATE OUTPUT:", output)
18
-
19
  if not output or not isinstance(output, list):
20
  return "Error: No model output."
21
 
@@ -23,7 +25,7 @@ def generate_3d(prompt):
23
  response = requests.get(glb_url)
24
 
25
  if response.status_code != 200:
26
- return f"Failed to download GLB file. Status code: {response.status_code}"
27
 
28
  file_name = f"{uuid.uuid4()}.glb"
29
  with open(file_name, 'wb') as f:
 
1
+ import gradio as gr
2
  import replicate
3
  import requests
4
  import os
 
11
  try:
12
  output = replicate.run(
13
  "openai/shap-e:9c9ecb8d35d0cc0ecde68b8a0d4a2f94f2bc6ee9393e8c3d76c44d7c0d75b1f9",
14
+ input={
15
+ "prompt": prompt,
16
+ "guidance_scale": 15,
17
+ "num_inference_steps": 64
18
+ }
19
  )
20
 
 
 
21
  if not output or not isinstance(output, list):
22
  return "Error: No model output."
23
 
 
25
  response = requests.get(glb_url)
26
 
27
  if response.status_code != 200:
28
+ return f"Download failed: {response.status_code}"
29
 
30
  file_name = f"{uuid.uuid4()}.glb"
31
  with open(file_name, 'wb') as f: