import gradio as gr
def name_to_markdown(name, network):
if(network == "twitter"):
return f"[{name}](https://twitter.com/{name})"
else:
return f"[{name}](https://huggingface.co/{name})"
def show_template(name, description, authors, url, image_url, more_info=None):
if isinstance(authors, str):
authors = [authors]
authors_md = ", ".join([name_to_markdown(author, network) for author, network in authors])
with gr.Group():
with gr.Row():
with gr.Column(scale=1):
gr.HTML(f'''''')
with gr.Column(scale=4):
gr.Markdown(
f"""
## {name}
[]({url})
#### {description}
**Author(s):** {authors_md}
"""
)
if more_info:
with gr.Row():
with gr.Accordion("👀 More Details", open=False):
gr.Markdown(more_info)
title_and_description = """
# Spaces Templates