zRzRzRzRzRzRzR commited on
Commit
c26219e
1 Parent(s): cc3fdc5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
README.md CHANGED
@@ -35,8 +35,10 @@ device = "cuda"
35
  tokenizer = AutoTokenizer.from_pretrained("THUDM/glm-4v-9b", trust_remote_code=True)
36
 
37
  query = '描述这张图片'
 
38
  image = Image.open("your image").convert('RGB')
39
- inputs = tokenizer.apply_chat_template([{"role": "user", "image": image, "content": "描述这张图片"}],
 
40
  add_generation_prompt=True, tokenize=True, return_tensors="pt",
41
  return_dict=True) # chat mode
42
 
 
35
  tokenizer = AutoTokenizer.from_pretrained("THUDM/glm-4v-9b", trust_remote_code=True)
36
 
37
  query = '描述这张图片'
38
+
39
  image = Image.open("your image").convert('RGB')
40
+
41
+ inputs = tokenizer.apply_chat_template([{"role": "user", "image": image, "content": query}],
42
  add_generation_prompt=True, tokenize=True, return_tensors="pt",
43
  return_dict=True) # chat mode
44