mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
fix filename regex for whisper
This commit is contained in:
parent
f545f4df75
commit
7fef0bc949
1 changed files with 2 additions and 2 deletions
|
@ -2743,8 +2743,8 @@ class KcppServerRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|||
if boundary:
|
||||
fparts = body.split(boundary)
|
||||
for fpart in fparts:
|
||||
detected_upload_filename = re.findall(r'Content-Disposition[^;]*;\s*name=(?:"file"|file)\s*;\s*filename="([^"]+)"', fpart.decode('utf-8',errors='ignore'),flags=re.IGNORECASE)
|
||||
detected_upload_filename_comfy = re.findall(r'Content-Disposition[^;]*;\s*name=(?:"image"|image)\s*;\s*filename="([^"]+)""', fpart.decode('utf-8',errors='ignore'),flags=re.IGNORECASE)
|
||||
detected_upload_filename = re.findall(r'Content-Disposition[^;]*;\s*name=(?:"file"|file)\s*;\s*filename=(?:"([^"]+)"|([^\s";]+))', fpart.decode('utf-8',errors='ignore'),flags=re.IGNORECASE)
|
||||
detected_upload_filename_comfy = re.findall(r'Content-Disposition[^;]*;\s*name=(?:"image"|image)\s*;\s*filename=(?:"([^"]+)"|([^\s";]+))', fpart.decode('utf-8',errors='ignore'),flags=re.IGNORECASE)
|
||||
if detected_upload_filename and len(detected_upload_filename)>0:
|
||||
utfprint(f"Detected uploaded file: {detected_upload_filename[0]}")
|
||||
file_content_start = fpart.find(b'\r\n\r\n') + 4 # Position after headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue