Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,6 @@ def load_model():
|
|
30 |
return llm
|
31 |
|
32 |
|
33 |
-
llm = load_model()
|
34 |
-
print("INFO: Model loaded successfully!")
|
35 |
|
36 |
|
37 |
@app.get("/")
|
@@ -43,12 +41,11 @@ def greet_json():
|
|
43 |
def query(data: RequestData):
|
44 |
prompt = data.prompt
|
45 |
image = data.image
|
|
|
46 |
|
47 |
try:
|
48 |
# decode base64 to image
|
49 |
-
|
50 |
-
data_uri = image
|
51 |
-
|
52 |
messages = [
|
53 |
{"role": "system", "content": "You are an assistant who perfectly describes images."},
|
54 |
{
|
|
|
30 |
return llm
|
31 |
|
32 |
|
|
|
|
|
33 |
|
34 |
|
35 |
@app.get("/")
|
|
|
41 |
def query(data: RequestData):
|
42 |
prompt = data.prompt
|
43 |
image = data.image
|
44 |
+
llm = load_model()
|
45 |
|
46 |
try:
|
47 |
# decode base64 to image
|
48 |
+
data_uri = f"""data:image/png;base64,{image}"""
|
|
|
|
|
49 |
messages = [
|
50 |
{"role": "system", "content": "You are an assistant who perfectly describes images."},
|
51 |
{
|