Created
August 26, 2023 19:08
-
-
Save waynegraham/4e4d40537440d0e2a1ffd21ad7631c1f to your computer and use it in GitHub Desktop.
Create text files for LORA model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
def create_text_file(jpeg_file): | |
"""Creates a text file with the same name as the given JPEG file.""" | |
text_file_name = jpeg_file.split(".")[0] + ".txt" | |
text_file = open(text_file_name, "w") | |
text_file.write("") | |
text_file.close() | |
jpeg_files = os.listdir('.') | |
for jpeg_file in jpeg_files: | |
if jpeg_file.endswith(".JPEG") or jpeg_file.endswith(".JPG"): | |
create_text_file(jpeg_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment