Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ os.putenv("HF_HUB_ENABLE_HF_TRANSFER", "1")
|
|
| 16 |
|
| 17 |
# Use gr.State to hold the predictor. Initialize it to None.
|
| 18 |
predictor_state = gr.State(None)
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
def init_predictor(task_type: str):
|
|
@@ -35,7 +36,6 @@ def init_predictor(task_type: str):
|
|
| 35 |
parameters_level=True,
|
| 36 |
),
|
| 37 |
use_multiprocessing=False,
|
| 38 |
-
device="cuda:0" if torch.cuda.is_available() else "cpu" # Pass device to the constructor
|
| 39 |
)
|
| 40 |
return predictor
|
| 41 |
except (RepositoryNotFoundError, RevisionNotFoundError, EntryNotFoundError) as e:
|
|
|
|
| 16 |
|
| 17 |
# Use gr.State to hold the predictor. Initialize it to None.
|
| 18 |
predictor_state = gr.State(None)
|
| 19 |
+
device="cuda:0" if torch.cuda.is_available() else "cpu" # Pass device to the constructor
|
| 20 |
|
| 21 |
|
| 22 |
def init_predictor(task_type: str):
|
|
|
|
| 36 |
parameters_level=True,
|
| 37 |
),
|
| 38 |
use_multiprocessing=False,
|
|
|
|
| 39 |
)
|
| 40 |
return predictor
|
| 41 |
except (RepositoryNotFoundError, RevisionNotFoundError, EntryNotFoundError) as e:
|