Spaces:
Running on Zero
Running on Zero
Commit ·
081066a
1
Parent(s): f4b410d
[Admin maintenance] Support new ZeroGPU hardware (#6)
Browse files- [Admin maintenance] Support new ZeroGPU hardware (99578a78e64e946f86cb82622887ac219a1a4244)
- app.py +2 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -12,6 +12,8 @@ if not hasattr(huggingface_hub, "HfFolder"):
|
|
| 12 |
try: huggingface_hub.logout()
|
| 13 |
except Exception: pass
|
| 14 |
huggingface_hub.HfFolder = HfFolder
|
|
|
|
|
|
|
| 15 |
import gradio as gr
|
| 16 |
import torch
|
| 17 |
from transformers import AutoConfig, AutoModelForCausalLM
|
|
@@ -21,7 +23,6 @@ from PIL import Image
|
|
| 21 |
|
| 22 |
import numpy as np
|
| 23 |
import os
|
| 24 |
-
import spaces # Import spaces for ZeroGPU compatibility
|
| 25 |
|
| 26 |
|
| 27 |
# Load model and processor
|
|
|
|
| 12 |
try: huggingface_hub.logout()
|
| 13 |
except Exception: pass
|
| 14 |
huggingface_hub.HfFolder = HfFolder
|
| 15 |
+
import spaces # Import spaces for ZeroGPU compatibility. Must precede torch/transformers/janus
|
| 16 |
+
# imports: spaces patches torch.cuda before CUDA is initialized in the parent process.
|
| 17 |
import gradio as gr
|
| 18 |
import torch
|
| 19 |
from transformers import AutoConfig, AutoModelForCausalLM
|
|
|
|
| 23 |
|
| 24 |
import numpy as np
|
| 25 |
import os
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
# Load model and processor
|
requirements.txt
CHANGED
|
@@ -4,5 +4,6 @@ gradio
|
|
| 4 |
numpy
|
| 5 |
torch
|
| 6 |
safetensors
|
| 7 |
-
transformers
|
|
|
|
| 8 |
git+https://github.com/deepseek-ai/Janus
|
|
|
|
| 4 |
numpy
|
| 5 |
torch
|
| 6 |
safetensors
|
| 7 |
+
transformers<5.0.0
|
| 8 |
+
pydantic<2.11
|
| 9 |
git+https://github.com/deepseek-ai/Janus
|