Spaces:
Running on A10G

zxhezexin commited on
Commit
7af53da
1 Parent(s): 5f677b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import os
3
  import uuid
4
  import subprocess
 
5
  from huggingface_hub import hf_hub_download
6
 
7
  from lrm.inferrer import LRMInferrer
@@ -38,7 +39,7 @@ def infer_wrapper(source_image, checkbox_rembg):
38
  directory, extension = os.path.split(source_image)
39
  file_extension = os.path.splitext(extension)[1]
40
  new_file_path = os.path.join(directory, random_uuid + file_extension)
41
- os.rename(source_image, new_file_path)
42
  print(f"File renamed from {source_image} to {new_file_path}")
43
  source_image = new_file_path
44
 
 
2
  import os
3
  import uuid
4
  import subprocess
5
+ import shutil
6
  from huggingface_hub import hf_hub_download
7
 
8
  from lrm.inferrer import LRMInferrer
 
39
  directory, extension = os.path.split(source_image)
40
  file_extension = os.path.splitext(extension)[1]
41
  new_file_path = os.path.join(directory, random_uuid + file_extension)
42
+ shutil.copy(source_image, new_file_path)
43
  print(f"File renamed from {source_image} to {new_file_path}")
44
  source_image = new_file_path
45