Spaces:
Sleeping
Sleeping
Jiaming Han
commited on
Commit
·
bb89818
1
Parent(s):
3b97045
fix
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def generate_text(self, image: str, prompt: str) -> str:
|
|
9 |
image = image.convert('RGB')
|
10 |
image = to_tensor(image).unsqueeze(0).to(self.device)
|
11 |
|
12 |
-
image_code = self.visual_tokenizer.encoder(image)['bottleneck_rep']
|
13 |
image_text = "".join([f"<I{x}>" for x in image_code[0].cpu().tolist()])
|
14 |
|
15 |
messages = [
|
|
|
9 |
image = image.convert('RGB')
|
10 |
image = to_tensor(image).unsqueeze(0).to(self.device)
|
11 |
|
12 |
+
image_code = self.visual_tokenizer.encoder(image.to(self.config.dtype))['bottleneck_rep']
|
13 |
image_text = "".join([f"<I{x}>" for x in image_code[0].cpu().tolist()])
|
14 |
|
15 |
messages = [
|