jackycedar commited on
Commit
a2b24ce
·
1 Parent(s): b0ea2a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -257,14 +257,13 @@ def pdfv3(in1, in2):
257
  def storeIndex1(files):
258
  newPath = home_path
259
  new_name = 'index1'
260
- ext = 'json'
261
  # # Separate file name and extension
262
  # name, ext = os.path.splitext(files.name)
263
  # # Concatenate new name and original extension
264
  new_path = os.path.join(newPath, new_name + ext)
265
  # Move file to new location with new name
266
- # print(files.name)
267
- print(files)
268
  print(new_path)
269
  os.rename(files, new_path)
270
  return
@@ -295,7 +294,7 @@ with gr.Blocks() as demo:
295
  outIndex1 = gr.File(label="IndexJson", interactive=True)
296
  inp1.change(pdfv1, inputs=[inp1,chainType1], outputs=[out1, outIndex1])
297
  doSum1.click(pdfv1, inputs=[inp1,chainType1], outputs=[out1, outIndex1])
298
- outIndex1.change(storeIndex1, inp1)
299
  gr.Markdown("""# Q&A""")
300
  question1 = gr.Textbox(label="Question related to the pdf", placeholder = "Question...")
301
  gr.Examples(
 
257
  def storeIndex1(files):
258
  newPath = home_path
259
  new_name = 'index1'
260
+ ext = '.json'
261
  # # Separate file name and extension
262
  # name, ext = os.path.splitext(files.name)
263
  # # Concatenate new name and original extension
264
  new_path = os.path.join(newPath, new_name + ext)
265
  # Move file to new location with new name
266
+ print(files.name)
 
267
  print(new_path)
268
  os.rename(files, new_path)
269
  return
 
294
  outIndex1 = gr.File(label="IndexJson", interactive=True)
295
  inp1.change(pdfv1, inputs=[inp1,chainType1], outputs=[out1, outIndex1])
296
  doSum1.click(pdfv1, inputs=[inp1,chainType1], outputs=[out1, outIndex1])
297
+ outIndex1.change(storeIndex1, outIndex1)
298
  gr.Markdown("""# Q&A""")
299
  question1 = gr.Textbox(label="Question related to the pdf", placeholder = "Question...")
300
  gr.Examples(