Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from typing import Dict
|
|
8 |
from datetime import datetime
|
9 |
import numpy as np
|
10 |
import base64
|
11 |
-
import os, io
|
12 |
|
13 |
# Load the model in half-precision on the available device(s)
|
14 |
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
@@ -41,6 +41,7 @@ def generate_embeddings(text):
|
|
41 |
|
42 |
def describe_image(image_array):
|
43 |
image_path = array_to_image_path(image_array)
|
|
|
44 |
image = Image.open(image_path)
|
45 |
|
46 |
messages = [
|
|
|
8 |
from datetime import datetime
|
9 |
import numpy as np
|
10 |
import base64
|
11 |
+
import os, stat, io
|
12 |
|
13 |
# Load the model in half-precision on the available device(s)
|
14 |
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
|
|
41 |
|
42 |
def describe_image(image_array):
|
43 |
image_path = array_to_image_path(image_array)
|
44 |
+
os.chmod(image_path, stat.S_IROTH)
|
45 |
image = Image.open(image_path)
|
46 |
|
47 |
messages = [
|