Skip to content

Commit

Permalink
🐛 fix(controller): correct metadata and verification checks
Browse files Browse the repository at this point in the history
- Add proper formatting to metadata description
- Update NovelAI signature and latent space verifications
  • Loading branch information
sudoskys committed Sep 27, 2024
1 parent 87dcda0 commit 4d8b1b2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,24 @@ async def tagger(self, file) -> str:
except Exception as e:
logger.info(f"Empty metadata {e}")
else:
content.append(f"**📦 Description:** `{read_prompt}`")
content.append(f"**📦 Description:** ```{read_prompt}```")
if read_model:
content.append(f"**📦 Model:** `{read_model.value}`")
if meta_data.Source:
content.append(f"**📦 Source:** `{meta_data.Source}`")
content.append(f"**📦 Mode**: `{mode}`")
try:
is_novelai = False
has_latent = False
file_data.seek(0)
is_novelai = ImageVerifier().verify(file_data)
is_novelai, has_latent = ImageVerifier().verify(file_data)
except Exception:
is_novelai = False
if not is_novelai:
content.append("**🧊 Not Signed by NovelAI**")
logger.debug("Not NovelAI")
else:
if not is_novelai:
content.append("**🧊 Not Signed by NovelAI**")
if not has_latent:
content.append("**🧊 No Latent Space**")
if result.characters:
content.append(f"**🌟 Characters:** `{','.join(result.characters)}`")
prompt = telegramify_markdown.convert("\n".join(content))
Expand Down

0 comments on commit 4d8b1b2

Please sign in to comment.