Spaces:
Running
Running
Akshayram1
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from smolagents.agents import ToolCallingAgent
|
3 |
-
from smolagents import tool,
|
4 |
from typing import Optional
|
5 |
import cv2
|
6 |
import pytesseract
|
@@ -8,8 +8,8 @@ from PIL import Image
|
|
8 |
import io
|
9 |
import numpy as np
|
10 |
|
11 |
-
# Define the
|
12 |
-
model =
|
13 |
|
14 |
@tool
|
15 |
def extract_components(image_data: bytes) -> str:
|
|
|
1 |
import streamlit as st
|
2 |
from smolagents.agents import ToolCallingAgent
|
3 |
+
from smolagents import tool, LiteLLMModel
|
4 |
from typing import Optional
|
5 |
import cv2
|
6 |
import pytesseract
|
|
|
8 |
import io
|
9 |
import numpy as np
|
10 |
|
11 |
+
# Define the LiteLLMModel with OpenAI key
|
12 |
+
model = LiteLLMModel(model_id="gpt-4o", api_key="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")
|
13 |
|
14 |
@tool
|
15 |
def extract_components(image_data: bytes) -> str:
|