Spaces:
Runtime error
Runtime error
fixed tokenizr
Browse files
app.py
CHANGED
|
@@ -224,7 +224,8 @@ def generate2(
|
|
| 224 |
is_gpu = False
|
| 225 |
device = CUDA(0) if is_gpu else "cpu"
|
| 226 |
clip_model, preprocess = clip.load("ViT-B/16", device=device, jit=False)
|
| 227 |
-
|
|
|
|
| 228 |
|
| 229 |
def inference(img, text, is_translate):
|
| 230 |
prefix_length = 10
|
|
|
|
| 224 |
is_gpu = False
|
| 225 |
device = CUDA(0) if is_gpu else "cpu"
|
| 226 |
clip_model, preprocess = clip.load("ViT-B/16", device=device, jit=False)
|
| 227 |
+
from transformers import AutoTokenizer
|
| 228 |
+
tokenizer = AutoTokenizer.from_pretrained("imthanhlv/gpt2news")
|
| 229 |
|
| 230 |
def inference(img, text, is_translate):
|
| 231 |
prefix_length = 10
|