Spaces:
Runtime error
Runtime error
fixed tokenizer
Browse files
app.py
CHANGED
@@ -240,7 +240,7 @@ def inference(img, text, is_translate):
|
|
240 |
# encode text
|
241 |
if text is None:
|
242 |
return "No text provided"
|
243 |
-
text =
|
244 |
with torch.no_grad():
|
245 |
prefix = clip_model.encode_text(text).to(device, dtype=torch.float32)
|
246 |
|
|
|
240 |
# encode text
|
241 |
if text is None:
|
242 |
return "No text provided"
|
243 |
+
text = clip.tokenize([text]).to(device)
|
244 |
with torch.no_grad():
|
245 |
prefix = clip_model.encode_text(text).to(device, dtype=torch.float32)
|
246 |
|