wangrongsheng commited on
Commit
700ff77
1 Parent(s): 8c05f18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -597,7 +597,11 @@ class Reader:
597
  "cost": str(cost),
598
  }
599
  md_text = "\n".join(htmls)
600
- return markdown.markdown(md_text), pos_count
 
 
 
 
601
 
602
  @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4,
603
  max=10),
@@ -780,7 +784,7 @@ def upload_pdf(api_keys, text, model_name, p, temperature, file):
780
  temperature=temperature)
781
  sum_info, cost = reader.summary_with_chat(
782
  paper_list=paper_list) # type: ignore
783
- return cost, sum_info
784
 
785
 
786
  api_title = "api-key可用验证"
@@ -856,7 +860,7 @@ ip = [
856
 
857
  chatpaper_gui = gradio.Interface(fn=upload_pdf,
858
  inputs=ip,
859
- outputs=["json", "html"],
860
  title=title,
861
  description=description)
862
 
 
597
  "cost": str(cost),
598
  }
599
  md_text = "\n".join(htmls)
600
+
601
+ with open(os.path.join('./', 'output.md'), "w", encoding="utf8") as f:
602
+ f.write(md_text)
603
+
604
+ return markdown.markdown(md_text), pos_count, os.path.join('./', 'output.md')
605
 
606
  @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4,
607
  max=10),
 
784
  temperature=temperature)
785
  sum_info, cost = reader.summary_with_chat(
786
  paper_list=paper_list) # type: ignore
787
+ return cost, sum_info, path
788
 
789
 
790
  api_title = "api-key可用验证"
 
860
 
861
  chatpaper_gui = gradio.Interface(fn=upload_pdf,
862
  inputs=ip,
863
+ outputs=["json", "html", 'file'],
864
  title=title,
865
  description=description)
866