Akshayram1 commited on
Commit
df9b46a
·
verified ·
1 Parent(s): 943fc90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -6,6 +6,7 @@ import cv2
6
  import pytesseract
7
  from PIL import Image
8
  import io
 
9
 
10
  # Define the LiteLLMModel
11
  model = LiteLLMModel(model_id="gpt-4o")
@@ -53,8 +54,8 @@ uploaded_file = st.file_uploader("Upload a web design image", type=["png", "jpg"
53
  if st.button("Extract and Generate Code"):
54
  if uploaded_file is not None:
55
  image_data = uploaded_file.read()
56
- components = agent.run("extract_components", image_data=image_data)
57
- code = agent.run("generate_code", components=components)
58
  st.write("Extracted Components:", components)
59
  st.write("Generated Code:", code)
60
  else:
 
6
  import pytesseract
7
  from PIL import Image
8
  import io
9
+ import numpy as np
10
 
11
  # Define the LiteLLMModel
12
  model = LiteLLMModel(model_id="gpt-4o")
 
54
  if st.button("Extract and Generate Code"):
55
  if uploaded_file is not None:
56
  image_data = uploaded_file.read()
57
+ components = agent.run(f"extract_components {image_data}")
58
+ code = agent.run(f"generate_code {components}")
59
  st.write("Extracted Components:", components)
60
  st.write("Generated Code:", code)
61
  else: