Spaces:
Build error
Build error
Update app.py
Browse files
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("/
|
| 22 |
-
os.makedirs("/content/Data/
|
| 23 |
-
download_pdf_from_url(pdf_url)
|
| 24 |
-
documents = SimpleDirectoryReader("/
|
| 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|>")
|