NicolasG2523 commited on
Commit
62e8374
·
verified ·
1 Parent(s): df12571

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +5 -5
gradio_app.py CHANGED
@@ -31,7 +31,7 @@ from hy3dgen.shapegen.utils import logger
31
 
32
  MAX_SEED = 1e7
33
 
34
- import spaces
35
  import subprocess
36
  import sys
37
  import shlex
@@ -41,8 +41,9 @@ print('install custom')
41
  subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
42
 
43
  @spaces.GPU
44
- def dummy_function():
45
- pass
 
46
 
47
  def get_example_img_list():
48
  print('Loading example img list ...')
@@ -362,7 +363,6 @@ def shape_generation(
362
  )
363
 
364
 
365
- @spaces.GPU
366
  def build_app():
367
  title = 'Hunyuan3D-2: High Resolution Textured 3D Assets Generation'
368
  if MV_MODE:
@@ -658,7 +658,7 @@ def build_app():
658
  if __name__ == '__main__':
659
  import argparse
660
 
661
- dummy_function()
662
 
663
  parser = argparse.ArgumentParser()
664
  parser.add_argument("--model_path", type=str, default='tencent/Hunyuan3D-2mv')
 
31
 
32
  MAX_SEED = 1e7
33
 
34
+ from gradio.decorators import spaces
35
  import subprocess
36
  import sys
37
  import shlex
 
41
  subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
42
 
43
  @spaces.GPU
44
+ def my_gpu_function(text):
45
+ # Your GPU-enabled code here
46
+ return text + " processed on GPU"
47
 
48
  def get_example_img_list():
49
  print('Loading example img list ...')
 
363
  )
364
 
365
 
 
366
  def build_app():
367
  title = 'Hunyuan3D-2: High Resolution Textured 3D Assets Generation'
368
  if MV_MODE:
 
658
  if __name__ == '__main__':
659
  import argparse
660
 
661
+ gr.Interface(fn=my_gpu_function, inputs="text", outputs="text")
662
 
663
  parser = argparse.ArgumentParser()
664
  parser.add_argument("--model_path", type=str, default='tencent/Hunyuan3D-2mv')