Update BrainBot.py
Browse files16 unmodified lines17181920212223245 unmodified lines3031323334353616 unmodified linesfile_content = uploaded_file.read() # Load the document# Create a directory if it doesn't existdata_dir = "data"# os.makedirs(data_dir, exist_ok=True)# Create a temporary file in the data directorywith tempfile.NamedTemporaryFile(delete=False, dir=data_dir) as temp_file:5 unmodified linesdef save_uploaded_image(uploaded_image):# Create a directory named "images" if it doesn't existimages_dir = "/images"# os.makedirs(images_dir, exist_ok=True)# Create a temporary file path within the "images" directory with .png extensiontemp_file_path = os.path.join(images_dir, tempfile.NamedTemporaryFile(suffix=".png").name)16 unmodified lines17181920212223245 unmodified lines3031323334353616 unmodified linesfile_content = uploaded_file.read() # Load the document# Create a directory if it doesn't existdata_dir = "/data"os.makedirs(data_dir, exist_ok=True)# Create a temporary file in the data directorywith tempfile.NamedTemporaryFile(delete=False, dir=data_dir) as temp_file:5 unmodified linesdef save_uploaded_image(uploaded_image):# Create a directory named "images" if it doesn't existimages_dir = "/images"os.makedirs(images_dir, exist_ok=True)# Create a temporary file path within the "images" directory with .png extensiontemp_file_path = os.path.join(images_dir, tempfile.NamedTemporaryFile(suffix=".png").name)
BrainBot.py+3-3