Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
vinid committed Sep 8, 2024
1 parent 6fd2a36 commit aa4348c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 230 deletions.
16 changes: 16 additions & 0 deletions textgrad/engine/engine_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def is_jpeg(data):
jpeg_signature = b'\xFF\xD8\xFF'
return data.startswith(jpeg_signature)

def is_png(data):
png_signature = b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A'
return data.startswith(png_signature)


def get_image_type_from_bytes(data):
if is_jpeg(data):
return "jpeg"
elif is_png(data):
return "png"
else:
raise ValueError("Image type not supported, only jpeg and png supported.")
230 changes: 0 additions & 230 deletions textgrad/engine/utils.py

This file was deleted.

0 comments on commit aa4348c

Please sign in to comment.