multilang-asr-subtitler / utils /zip_response.py
marquesafonso's picture
added project files
748e637
raw
history blame
318 Bytes
import zipfile, os
def zip_response(temp_zip_file: str, files: list):
with zipfile.ZipFile(temp_zip_file, 'w') as zipf:
for file in files:
zipf.write(file, arcname=os.path.basename(file))
with open(temp_zip_file, 'rb') as zip_file:
zip_bytes = zip_file.read()
return zip_bytes