Nechba commited on
Commit
48ad327
·
verified ·
1 Parent(s): 49917f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -132,24 +132,13 @@ if uploaded_files and api_key:
132
  try:
133
  # Analyze PDF directly
134
  # Convert PDF to images
135
- images = pdf_to_images(uploaded_file.getvalue())
136
 
137
- # Analyze document
138
- raw_response = analyze_single_document(images, PROMPT)
139
-
140
- # raw_response = analyze_pdf_directly(
141
- # pdf_bytes=uploaded_file.getvalue(),
142
- # prompt=PROMPT,
143
- # model_name="gemini-1.5-pro" # or "gemini-1.5-flash"
144
- # )
145
-
146
- # Process response
147
- csv_data = extract_csv_from_response(raw_response)
148
 
149
  # Display results in expandable section
150
  with st.expander("View Analysis Results", expanded=True):
151
  if csv_data:
152
- df = csv_to_dataframe(csv_data)
153
  print(f"DataFrame: {df}")
154
  if not df.empty:
155
  st.dataframe(df)
 
132
  try:
133
  # Analyze PDF directly
134
  # Convert PDF to images
 
135
 
136
+ df = process_local_pdf(uploaded_file.getvalue())
 
 
 
 
 
 
 
 
 
 
137
 
138
  # Display results in expandable section
139
  with st.expander("View Analysis Results", expanded=True):
140
  if csv_data:
141
+
142
  print(f"DataFrame: {df}")
143
  if not df.empty:
144
  st.dataframe(df)