praeclarumjj3 commited on
Commit
964c876
1 Parent(s): 6688506

Update chat.py

Browse files
Files changed (1) hide show
  1. chat.py +2 -2
chat.py CHANGED
@@ -121,8 +121,8 @@ class Chat:
121
  stop_str = params.get("stop", None)
122
  do_sample = True if temperature > 0.001 else False
123
 
124
- if self.is_seg:
125
- if self.is_depth:
126
  input_ids = tokenizer_depth_seg_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, SEG_TOKEN_INDEX, DEPTH_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(self.device)
127
  else:
128
  input_ids = tokenizer_seg_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, SEG_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(self.device)
 
121
  stop_str = params.get("stop", None)
122
  do_sample = True if temperature > 0.001 else False
123
 
124
+ if self.is_seg and segs is not None:
125
+ if self.is_depth and depths is not None:
126
  input_ids = tokenizer_depth_seg_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, SEG_TOKEN_INDEX, DEPTH_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(self.device)
127
  else:
128
  input_ids = tokenizer_seg_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, SEG_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(self.device)