Spaces:
Runtime error
Runtime error
praeclarumjj3
commited on
Commit
•
964c876
1
Parent(s):
6688506
Update chat.py
Browse files
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)
|