artificialguybr commited on
Commit
db6196b
·
1 Parent(s): ad7e5e4

Fix: Import spaces before gradio/torch to prevent CUDA initialization error

Browse files

The ZeroGPU spaces package must be imported before any CUDA-related
packages. Moving spaces import to the top fixes RuntimeError on startup.

Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,8 +3,9 @@ Surya OCR Studio - Complete Implementation
3
  Features: OCR, Text Detection, Layout Analysis, Table Recognition, LaTeX OCR
4
  """
5
 
6
- import gradio as gr
7
  import spaces
 
8
  import logging
9
  import os
10
  import json
 
3
  Features: OCR, Text Detection, Layout Analysis, Table Recognition, LaTeX OCR
4
  """
5
 
6
+ # Import spaces FIRST before any CUDA-related packages
7
  import spaces
8
+ import gradio as gr
9
  import logging
10
  import os
11
  import json