Spaces:
Build error
Build error
Updated
Browse files
app.py
CHANGED
|
@@ -51,15 +51,15 @@ def main():
|
|
| 51 |
|
| 52 |
def send_to_gemini(drawing_path):
|
| 53 |
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest")
|
| 54 |
-
with open(drawing_path, 'rb') as img_file:
|
| 55 |
-
|
| 56 |
message = HumanMessage(
|
| 57 |
content=[
|
| 58 |
{
|
| 59 |
"type": "text",
|
| 60 |
"text": "Give me the answer of any mathematical representation in the image with the complete solution, and does not say the image contains etc.",
|
| 61 |
},
|
| 62 |
-
{"type": "image", "image":
|
| 63 |
]
|
| 64 |
)
|
| 65 |
response = llm.invoke([message]).content
|
|
|
|
| 51 |
|
| 52 |
def send_to_gemini(drawing_path):
|
| 53 |
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest")
|
| 54 |
+
# with open(drawing_path, 'rb') as img_file:
|
| 55 |
+
# image_content = img_file.read()
|
| 56 |
message = HumanMessage(
|
| 57 |
content=[
|
| 58 |
{
|
| 59 |
"type": "text",
|
| 60 |
"text": "Give me the answer of any mathematical representation in the image with the complete solution, and does not say the image contains etc.",
|
| 61 |
},
|
| 62 |
+
{"type": "image", "image": drawing_path},
|
| 63 |
]
|
| 64 |
)
|
| 65 |
response = llm.invoke([message]).content
|