cipherunhsiv commited on
Commit
9978c4b
·
verified ·
1 Parent(s): 6dd4ea0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -18,10 +18,10 @@ def download_pdf_from_url(url, save_path="/content/Data/input.pdf"):
18
  print(f"Failed to download PDF. Status code: {response.status_code}")
19
 
20
  def mod(pdf_url):
21
- if not os.path.exists("/content/Data/"):
22
- os.makedirs("/content/Data/")
23
- download_pdf_from_url(pdf_url)
24
- documents = SimpleDirectoryReader("/content/Data/").load_data()
25
  system_prompt = """You are an expert share market document summarizer specializing in creating concise, comprehensive summaries tailored for professional audiences. Your goal is to summarize pdf which may also include tabular columns, as
26
  accurately as possible based on the instructions and context provided."""
27
  query_wrapper_prompt = SimpleInputPrompt("<|USER|>{query_str}<|ASSISTANT|>")
 
18
  print(f"Failed to download PDF. Status code: {response.status_code}")
19
 
20
  def mod(pdf_url):
21
+ if not os.path.exists("/Data/"): # /content/Data --> /Data/
22
+ os.makedirs("/Data/") # /content/Data --> /Data/
23
+ download_pdf_from_url(pdf_url) # /content/Data --> /Data/
24
+ documents = SimpleDirectoryReader("/Data/").load_data()
25
  system_prompt = """You are an expert share market document summarizer specializing in creating concise, comprehensive summaries tailored for professional audiences. Your goal is to summarize pdf which may also include tabular columns, as
26
  accurately as possible based on the instructions and context provided."""
27
  query_wrapper_prompt = SimpleInputPrompt("<|USER|>{query_str}<|ASSISTANT|>")