mjl1206 commited on
Commit
eadfc10
·
verified ·
1 Parent(s): ee2c87c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -113,7 +113,7 @@ def load_image(image_data, input_size=384, max_num=10):
113
 
114
  model_path = 'LiAutoAD/Ristretto-3B'
115
  model = AutoModel.from_pretrained(
116
- path,
117
  torch_dtype=torch.bfloat16,
118
  trust_remote_code=True).eval().cuda()
119
  tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)
@@ -136,12 +136,12 @@ print(f'User: {question} Assistant: {response}')
136
 
137
  # text-image conversation && multi-round conversation
138
  question = '<image> Please describe the image.'
139
- response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
140
  print(f'User: {question} Assistant: {response}')
141
 
142
 
143
  question = 'What is best title for the image?'
144
- response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
145
  print(f'User: {question} Assistant: {response}')
146
 
147
  ```
 
113
 
114
  model_path = 'LiAutoAD/Ristretto-3B'
115
  model = AutoModel.from_pretrained(
116
+ model_path,
117
  torch_dtype=torch.bfloat16,
118
  trust_remote_code=True).eval().cuda()
119
  tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)
 
136
 
137
  # text-image conversation && multi-round conversation
138
  question = '<image> Please describe the image.'
139
+ response, history = model.chat(tokenizer, pixel_values, question, generation_config, num_image_token=num_image_token, history=None, return_history=True)
140
  print(f'User: {question} Assistant: {response}')
141
 
142
 
143
  question = 'What is best title for the image?'
144
+ response, history = model.chat(tokenizer, pixel_values, question, generation_config, num_image_token=num_image_token, history=history, return_history=True)
145
  print(f'User: {question} Assistant: {response}')
146
 
147
  ```