Skip to content

Commit

Permalink
feat: add warning header
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Aug 27, 2024
1 parent be0e3f7 commit d7cd87a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def main(api_url, ui_port):
inputs=gr_inp,
outputs=gr_out,
title=metadata.get('name', ''),
description=inspect.cleandoc(metadata.get('description', '')),
description=ui_utils.generate_header(),
article=ui_utils.generate_footer(metadata),
theme=gr.themes.Default(
primary_hue=gr.themes.colors.cyan,
Expand Down
12 changes: 12 additions & 0 deletions ui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ def api_call(
return rout


def generate_header():
header = f"""
<div style="background-color: #032c80; padding: 10px; border-radius: 10px;">
ℹ️ This is a temporary deployment that will automatically delete itself after
<b>10 minutes</b>. To access more permanent inference options,
<a href="https://docs.ai4eosc.eu/en/latest/user/overview/auth.html" style="color: #76b2de;">become a member of one of the supported projects</a>.
</div>
"""
header = inspect.cleandoc(header)
return header


def generate_footer(metadata):

# Retrieve git info
Expand Down

0 comments on commit d7cd87a

Please sign in to comment.