Spaces:
Running
Running
add zero
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ import flax.linen as nn
|
|
| 11 |
import jax
|
| 12 |
import jax.numpy as jnp
|
| 13 |
import numpy as np
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
hf_token = os.getenv("HF_TOKEN")
|
|
@@ -21,7 +22,7 @@ model = PaliGemmaForConditionalGeneration.from_pretrained(model_id, use_auth_tok
|
|
| 21 |
processor = PaliGemmaProcessor.from_pretrained(model_id)
|
| 22 |
|
| 23 |
###### Transformers Inference
|
| 24 |
-
|
| 25 |
def infer(
|
| 26 |
image: PIL.Image.Image,
|
| 27 |
text: str,
|
|
|
|
| 11 |
import jax
|
| 12 |
import jax.numpy as jnp
|
| 13 |
import numpy as np
|
| 14 |
+
import spaces
|
| 15 |
|
| 16 |
|
| 17 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
|
| 22 |
processor = PaliGemmaProcessor.from_pretrained(model_id)
|
| 23 |
|
| 24 |
###### Transformers Inference
|
| 25 |
+
@spaces.GPU
|
| 26 |
def infer(
|
| 27 |
image: PIL.Image.Image,
|
| 28 |
text: str,
|