Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,7 +28,7 @@ def image_to_base64(image_path):
28
  encoded_string = base64.b64encode(img.read()).decode('utf-8')
29
  return f"data:image/jpeg;base64,{encoded_string}"
30
 
31
- @spaces.GPU(duration=45)
32
  def run_inference(message, history):
33
  ## may work
34
  messages = []
@@ -51,7 +51,7 @@ def run_inference(message, history):
51
  images = encoded.images
52
  tokens = encoded.tokens
53
 
54
- out_tokens, _ = generate([tokens], model, images=[images], max_tokens=1024, temperature=0.45, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
55
  result = tokenizer.decode(out_tokens[0])
56
  return result
57
 
 
28
  encoded_string = base64.b64encode(img.read()).decode('utf-8')
29
  return f"data:image/jpeg;base64,{encoded_string}"
30
 
31
+ @spaces.GPU(duration=60)
32
  def run_inference(message, history):
33
  ## may work
34
  messages = []
 
51
  images = encoded.images
52
  tokens = encoded.tokens
53
 
54
+ out_tokens, _ = generate([tokens], model, images=[images], max_tokens=512, temperature=0.45, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
55
  result = tokenizer.decode(out_tokens[0])
56
  return result
57