vitorcalvi commited on
Commit
866c25e
1 Parent(s): b185999

Add application file

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -20,8 +20,14 @@ import torch
20
  # Import the UI components
21
  from ui_components import CUSTOM_CSS, HEADER_HTML, DISCLAIMER_HTML
22
 
23
- # Check for GPU availability
24
- device = "cuda" if torch.cuda.is_available() else "cpu"
 
 
 
 
 
 
25
 
26
  TAB_STRUCTURE = [
27
  ("Visual Analysis", [
@@ -49,7 +55,7 @@ TAB_STRUCTURE = [
49
  ])
50
  ]
51
 
52
- @spaces.GPU
53
  def create_demo():
54
  with gr.Blocks(css=CUSTOM_CSS) as demo:
55
  gr.Markdown(HEADER_HTML)
 
20
  # Import the UI components
21
  from ui_components import CUSTOM_CSS, HEADER_HTML, DISCLAIMER_HTML
22
 
23
+
24
+ if torch.cuda.is_available():
25
+ device = "cuda"
26
+ print("Using GPU")
27
+ else:
28
+ device = "cpu"
29
+ print("Using CPU")
30
+
31
 
32
  TAB_STRUCTURE = [
33
  ("Visual Analysis", [
 
55
  ])
56
  ]
57
 
58
+
59
  def create_demo():
60
  with gr.Blocks(css=CUSTOM_CSS) as demo:
61
  gr.Markdown(HEADER_HTML)