Skip to content

Commit

Permalink
fixed write image error
Browse files Browse the repository at this point in the history
  • Loading branch information
Binghua Wu committed Mar 26, 2024
1 parent 30685a6 commit afa16d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/python/autogptq/autogptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import os
import time
import urllib.parse
import base64

import grpc
import backend_pb2
Expand Down Expand Up @@ -114,7 +114,7 @@ def recompile_vl_prompt(self, request):
timestamp = str(int(time.time() * 1000)) # Generate timestamp
img_path = f"/tmp/vl-{timestamp}.jpg" # Use timestamp in filename
with open(img_path, "wb") as f:
f.write(img)
f.write(base64.b64decode(img))
image_paths.append(img_path)
prompt = prompt.replace(f"[img-{i}]", "<img>" + img_path + "</img>,")
else:
Expand Down

0 comments on commit afa16d3

Please sign in to comment.