rishiraj commited on
Commit
5e7fcb9
1 Parent(s): cf23322

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -81,7 +81,7 @@ with gr.Blocks(title="PDF data extraction with Marker & Indexify") as marker_dem
81
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
82
  )
83
 
84
- pdf_file = gr.File(type="filepath")
85
 
86
  with gr.Column():
87
  gr.HTML("<p><b>Step 2:</b> Run the extractor.</p>")
@@ -91,9 +91,9 @@ with gr.Blocks(title="PDF data extraction with Marker & Indexify") as marker_dem
91
  variant="primary",
92
  )
93
 
94
- model_output_text_box = gr.Textbox(
95
  label="Extractor Output",
96
- elem_id="model_output_text_box",
97
  )
98
 
99
  with gr.Row():
@@ -107,8 +107,8 @@ with gr.Blocks(title="PDF data extraction with Marker & Indexify") as marker_dem
107
 
108
  go_button.click(
109
  fn=use_marker,
110
- inputs = [pdf_file],
111
- outputs = [model_output_text_box]
112
  )
113
 
114
  with gr.Blocks(title="PDF data extraction with PDF Extractor & Indexify") as pdf_demo:
@@ -127,7 +127,7 @@ with gr.Blocks(title="PDF data extraction with PDF Extractor & Indexify") as pdf
127
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
128
  )
129
 
130
- pdf_file = gr.File(type="filepath")
131
 
132
  with gr.Column():
133
  gr.HTML("<p><b>Step 2:</b> Run the extractor.</p>")
@@ -137,9 +137,9 @@ with gr.Blocks(title="PDF data extraction with PDF Extractor & Indexify") as pdf
137
  variant="primary",
138
  )
139
 
140
- model_output_text_box = gr.Textbox(
141
  label="Extractor Output",
142
- elem_id="model_output_text_box",
143
  )
144
 
145
  with gr.Row():
@@ -153,8 +153,8 @@ with gr.Blocks(title="PDF data extraction with PDF Extractor & Indexify") as pdf
153
 
154
  go_button.click(
155
  fn=use_pdf_extractor,
156
- inputs = [pdf_file],
157
- outputs = [model_output_text_box]
158
  )
159
 
160
  with gr.Blocks(title="PDF data extraction with Gemini & Indexify") as gemini_demo:
@@ -173,11 +173,11 @@ with gr.Blocks(title="PDF data extraction with Gemini & Indexify") as gemini_dem
173
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
174
  )
175
 
176
- pdf_file = gr.File(type="filepath")
177
 
178
  gr.HTML("<p><b>Step 2:</b> Enter your API key.</p>")
179
 
180
- key = gr.Textbox(
181
  info="Please enter your GEMINI_API_KEY",
182
  label="Key:"
183
  )
@@ -190,9 +190,9 @@ with gr.Blocks(title="PDF data extraction with Gemini & Indexify") as gemini_dem
190
  variant="primary",
191
  )
192
 
193
- model_output_text_box = gr.Textbox(
194
  label="Extractor Output",
195
- elem_id="model_output_text_box",
196
  )
197
 
198
  with gr.Row():
@@ -206,8 +206,8 @@ with gr.Blocks(title="PDF data extraction with Gemini & Indexify") as gemini_dem
206
 
207
  go_button.click(
208
  fn=use_gemini,
209
- inputs = [pdf_file, key],
210
- outputs = [model_output_text_box]
211
  )
212
 
213
  with gr.Blocks(title="PDF data extraction with OpenAI & Indexify") as openai_demo:
@@ -226,11 +226,11 @@ with gr.Blocks(title="PDF data extraction with OpenAI & Indexify") as openai_dem
226
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
227
  )
228
 
229
- pdf_file = gr.File(type="filepath")
230
 
231
  gr.HTML("<p><b>Step 2:</b> Enter your API key.</p>")
232
 
233
- key = gr.Textbox(
234
  info="Please enter your OPENAI_API_KEY",
235
  label="Key:"
236
  )
@@ -243,9 +243,9 @@ with gr.Blocks(title="PDF data extraction with OpenAI & Indexify") as openai_dem
243
  variant="primary",
244
  )
245
 
246
- model_output_text_box = gr.Textbox(
247
  label="Extractor Output",
248
- elem_id="model_output_text_box",
249
  )
250
 
251
  with gr.Row():
@@ -259,8 +259,8 @@ with gr.Blocks(title="PDF data extraction with OpenAI & Indexify") as openai_dem
259
 
260
  go_button.click(
261
  fn=use_openai,
262
- inputs = [pdf_file, key],
263
- outputs = [model_output_text_box]
264
  )
265
 
266
  demo = gr.TabbedInterface([marker_demo, pdf_demo, gemini_demo, openai_demo], ["Marker Extractor", "PDF Extractor", "Gemini Extractor", "OpenAI Extractor"], theme=gr.themes.Soft())
 
81
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
82
  )
83
 
84
+ pdf_file_marker = gr.File(type="filepath")
85
 
86
  with gr.Column():
87
  gr.HTML("<p><b>Step 2:</b> Run the extractor.</p>")
 
91
  variant="primary",
92
  )
93
 
94
+ model_output_text_box_marker = gr.Textbox(
95
  label="Extractor Output",
96
+ elem_id="model_output_text_box_marker",
97
  )
98
 
99
  with gr.Row():
 
107
 
108
  go_button.click(
109
  fn=use_marker,
110
+ inputs = [pdf_file_marker],
111
+ outputs = [model_output_text_box_marker]
112
  )
113
 
114
  with gr.Blocks(title="PDF data extraction with PDF Extractor & Indexify") as pdf_demo:
 
127
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
128
  )
129
 
130
+ pdf_file_pdf = gr.File(type="filepath")
131
 
132
  with gr.Column():
133
  gr.HTML("<p><b>Step 2:</b> Run the extractor.</p>")
 
137
  variant="primary",
138
  )
139
 
140
+ model_output_text_box_pdf = gr.Textbox(
141
  label="Extractor Output",
142
+ elem_id="model_output_text_box_pdf",
143
  )
144
 
145
  with gr.Row():
 
153
 
154
  go_button.click(
155
  fn=use_pdf_extractor,
156
+ inputs = [pdf_file_pdf],
157
+ outputs = [model_output_text_box_pdf]
158
  )
159
 
160
  with gr.Blocks(title="PDF data extraction with Gemini & Indexify") as gemini_demo:
 
173
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
174
  )
175
 
176
+ pdf_file_gemini = gr.File(type="filepath")
177
 
178
  gr.HTML("<p><b>Step 2:</b> Enter your API key.</p>")
179
 
180
+ key_gemini = gr.Textbox(
181
  info="Please enter your GEMINI_API_KEY",
182
  label="Key:"
183
  )
 
190
  variant="primary",
191
  )
192
 
193
+ model_output_text_box_gemini = gr.Textbox(
194
  label="Extractor Output",
195
+ elem_id="model_output_text_box_gemini",
196
  )
197
 
198
  with gr.Row():
 
206
 
207
  go_button.click(
208
  fn=use_gemini,
209
+ inputs = [pdf_file_gemini, key_gemini],
210
+ outputs = [model_output_text_box_gemini]
211
  )
212
 
213
  with gr.Blocks(title="PDF data extraction with OpenAI & Indexify") as openai_demo:
 
226
  "<a href='https://getindexify.ai/'>Indexify</a>.</p>"
227
  )
228
 
229
+ pdf_file_oai = gr.File(type="filepath")
230
 
231
  gr.HTML("<p><b>Step 2:</b> Enter your API key.</p>")
232
 
233
+ key_oai = gr.Textbox(
234
  info="Please enter your OPENAI_API_KEY",
235
  label="Key:"
236
  )
 
243
  variant="primary",
244
  )
245
 
246
+ model_output_text_box_oai = gr.Textbox(
247
  label="Extractor Output",
248
+ elem_id="model_output_text_box_oai",
249
  )
250
 
251
  with gr.Row():
 
259
 
260
  go_button.click(
261
  fn=use_openai,
262
+ inputs = [pdf_file_oai, key_oai],
263
+ outputs = [model_output_text_box_oai]
264
  )
265
 
266
  demo = gr.TabbedInterface([marker_demo, pdf_demo, gemini_demo, openai_demo], ["Marker Extractor", "PDF Extractor", "Gemini Extractor", "OpenAI Extractor"], theme=gr.themes.Soft())