perler commited on
Commit
6dbbf3c
·
1 Parent(s): 3434990

try spaces.gpu on only run()

Browse files
Files changed (2) hide show
  1. app.py +0 -2
  2. model.py +2 -0
app.py CHANGED
@@ -4,13 +4,11 @@ from __future__ import annotations
4
 
5
  import os
6
 
7
- import spaces
8
  import gradio as gr
9
 
10
  from model import Model
11
 
12
 
13
- @spaces.GPU
14
  def main():
15
  DESCRIPTION = '''# [TEXTure](https://github.com/TEXTurePaper/TEXTurePaper)
16
 
 
4
 
5
  import os
6
 
 
7
  import gradio as gr
8
 
9
  from model import Model
10
 
11
 
 
12
  def main():
13
  DESCRIPTION = '''# [TEXTure](https://github.com/TEXTurePaper/TEXTurePaper)
14
 
model.py CHANGED
@@ -9,6 +9,7 @@ from typing import Generator, Optional
9
 
10
  import gradio as gr
11
  import trimesh
 
12
 
13
  sys.path.append('TEXTurePaper')
14
 
@@ -50,6 +51,7 @@ class Model:
50
  subprocess.run(shlex.split(f'zip -r {out_path} {mesh_dir}'))
51
  return out_path
52
 
 
53
  def run(
54
  self, shape_path: str, text: str, seed: int, guidance_scale: float
55
  ) -> Generator[tuple[list[str], Optional[str], Optional[str], str], None,
 
9
 
10
  import gradio as gr
11
  import trimesh
12
+ import spaces
13
 
14
  sys.path.append('TEXTurePaper')
15
 
 
51
  subprocess.run(shlex.split(f'zip -r {out_path} {mesh_dir}'))
52
  return out_path
53
 
54
+ @spaces.GPU
55
  def run(
56
  self, shape_path: str, text: str, seed: int, guidance_scale: float
57
  ) -> Generator[tuple[list[str], Optional[str], Optional[str], str], None,