Skip to content

Commit

Permalink
bugfix: doc_parser with windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
JianxinMa committed Feb 27, 2024
1 parent aa0cc17 commit 6b73b72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qwen_agent/tools/doc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def process_file(url: str, db: Storage = None):
if url.split('.')[-1].lower() in ['pdf', 'docx', 'pptx']:
date1 = datetime.datetime.now()

if url.startswith('https://') or url.startswith('http://'):
if url.startswith('https://') or url.startswith('http://') or re.match(
r'^[A-Za-z]:\\', url) or re.match(r'^[A-Za-z]:/', url):
pdf_path = url
else:
parsed_url = urlparse(url)
Expand Down

0 comments on commit 6b73b72

Please sign in to comment.