twarner commited on
Commit
89d775f
·
1 Parent(s): 783cc24

Add ZeroGPU decorator for H200

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -7,6 +7,7 @@ import gradio as gr
7
  import torch
8
  import torch.nn as nn
9
  from pathlib import Path
 
10
 
11
  # Machine limits
12
  BOUNDS = {"left": -420.5, "right": 420.5, "top": 594.5, "bottom": -594.5}
@@ -292,6 +293,7 @@ def gcode_to_svg(gcode: str) -> str:
292
  return svg
293
 
294
 
 
295
  def generate(prompt: str, temperature: float, max_tokens: int, num_steps: int, guidance: float):
296
  """Generate gcode from text prompt via SD-Gcode diffusion."""
297
  if not prompt or not prompt.strip():
 
7
  import torch
8
  import torch.nn as nn
9
  from pathlib import Path
10
+ import spaces
11
 
12
  # Machine limits
13
  BOUNDS = {"left": -420.5, "right": 420.5, "top": 594.5, "bottom": -594.5}
 
293
  return svg
294
 
295
 
296
+ @spaces.GPU
297
  def generate(prompt: str, temperature: float, max_tokens: int, num_steps: int, guidance: float):
298
  """Generate gcode from text prompt via SD-Gcode diffusion."""
299
  if not prompt or not prompt.strip():