Spaces:
Running
on
Zero
Running
on
Zero
pixtral
#3
by
Kabilash10
- opened
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=
|
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=
|
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 |
|