lyttt commited on
Commit
ea1edb1
·
1 Parent(s): 9898ce0

Add application file

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -3,10 +3,11 @@ from transformers import AutoModel, AutoProcessor
3
  from PIL import Image
4
  import torch
5
 
 
 
 
6
  def greet(image):
7
- model_name_or_path = "lyttt/VLV_captioner"
8
- model = AutoModel.from_pretrained(model_name_or_path, revision="master", trust_remote_code=True,low_cpu_mem_usage=False)
9
- image = Image.open(image).convert("RGB")
10
  with torch.no_grad():
11
  outputs = model([image]).generated_text
12
 
 
3
  from PIL import Image
4
  import torch
5
 
6
+ model_name_or_path = "lyttt/VLV_captioner"
7
+ model = AutoModel.from_pretrained(model_name_or_path, revision="master", trust_remote_code=True,low_cpu_mem_usage=False)
8
+
9
  def greet(image):
10
+ image = image.convert("RGB")
 
 
11
  with torch.no_grad():
12
  outputs = model([image]).generated_text
13