new UI
Browse files1234522 unmodified lines282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132import gradio as grfrom app_cohere import demo as demo_coherefrom app_meta import demo as demo_metafrom app_lumaai import demo as demo_lumaai22 unmodified linesfrom app_showui import demo as demo_showuifrom app_omini import demo as demo_ominiwith gr.Blocks(fill_height=True) as demo:with gr.Tab("Gemini"):demo_gemini.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>")with gr.Tab("Grok"):demo_grok.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>")with gr.Tab("Cohere"):demo_cohere.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>")with gr.Tab("SambaNova (New QwQ-32B-Preview)"):demo_sambanova.render()gr.Markdown("""**Note:** You need to use a SambaNova API key from [SambaNova Cloud](https://cloud.sambanova.ai/).This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.""")with gr.Tab("Hyperbolic (New Meta Llama 3.3 70B)"):demo_hyperbolic.render()gr.Markdown("""<div><img src="https://storage.googleapis.com/public-arena-asset/hyperbolic_logo.png" alt="Hyperbolic Logo" style="height: 50px; margin-right: 10px;"></div>**Note:** This model is supported by Hyperbolic. Build your AI apps at [Hyperbolic](https://app.hyperbolic.xyz/).This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.""")with gr.Tab("OminiControl"):demo_omini.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Fireworks (New Meta Llama 3.3 70B)"):demo_fireworks.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Together (New Meta Llama 3.3 70B)"):demo_together.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Groq (New Meta Llama 3.3 70B)"):demo_groq.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Hugging Face (New Meta Llama 3.3 70B)"):demo_meta.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("LumaAI"):demo_lumaai.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio.<img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>")with gr.Tab("Paligemma 2"):gr.Markdown("paligemma2-10b-ft-docci-448 is a fine-tuned version of Paligemma 2 on the DOCCI dataset, which can accomplish a wide range of captioning tasks, including text rendering, capturing spatial relations, and including world knowledge in captions.")demo_paligemma.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Qwen"):demo_qwen.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Replicate"):demo_replicate.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Sailor"):demo_sailor.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Huggingface"):demo_huggingface.render()with gr.Tab("Fal"):demo_fal.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("ShowUI"):demo_showui.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("PlayAI"):demo_playai.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("ChatGPT"):demo_openai.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Claude"):demo_claude.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Allen AI"):demo_allenai.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Perplexity"):demo_perplexity.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Experimental"):demo_experimental.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Marco-o1"):demo_marco_o1.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("Mistral"):demo_mistral.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")with gr.Tab("NVIDIA"):demo_nvidia.render()gr.Markdown("This app is built with gradio, check out gradio github and star: <a href='https://github.com/gradio-app/gradio'>Gradio <img src='https://img.shields.io/github/stars/gradio-app/gradio'></a>.")if __name__ == "__main__":demo.queue(api_open=False).launch(show_api=False)12345622 unmodified lines293031323334353637383940414243444546474849505152535455565758596061626364656667686970from utils import get_app# Import all demosfrom app_cohere import demo as demo_coherefrom app_meta import demo as demo_metafrom app_lumaai import demo as demo_lumaai22 unmodified linesfrom app_showui import demo as demo_showuifrom app_omini import demo as demo_omini# Create mapping of models to their demosDEMOS = {"Gemini": demo_gemini,"Grok": demo_grok,"Cohere": demo_cohere,"SambaNova": demo_sambanova,"Hyperbolic": demo_hyperbolic,"OminiControl": demo_omini,"Fireworks": demo_fireworks,"Together": demo_together,"Groq": demo_groq,"Meta Llama": demo_meta,"LumaAI": demo_lumaai,"Paligemma": demo_paligemma,"Qwen": demo_qwen,"Replicate": demo_replicate,"Huggingface": demo_huggingface,"Fal": demo_fal,"ShowUI": demo_showui,"PlayAI": demo_playai,"ChatGPT": demo_openai,"Claude": demo_claude,"Allen AI": demo_allenai,"Perplexity": demo_perplexity,"Experimental": demo_experimental,"Mistral": demo_mistral,"NVIDIA": demo_nvidia,"Marco-o1": demo_marco_o1,"Sailor": demo_sailor,}demo = get_app(models=list(DEMOS.keys()),default_model="Gemini",src=DEMOS,)if __name__ == "__main__":demo.queue(api_open=False).launch(show_api=False)
12341 unmodified line67891011126 unmodified lines1920212223242526from typing import Callable, Literalimport gradio as gr1 unmodified linedef get_app(models: list[str],default_model: str,src: Callable[[str, str | None], gr.Blocks] | Literal["models"],accept_token: bool = False,**kwargs,) -> gr.Blocks:6 unmodified linescolumns = []for model_name in models:with gr.Column(visible=model_name == default_model) as column:gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs)columns.append(column)model.change(12341 unmodified line67891011126 unmodified lines19202122232425262728from typing import Callable, Literal, Dict, Unionimport gradio as gr1 unmodified linedef get_app(models: list[str],default_model: str,src: Union[Callable[[str, str | None], gr.Blocks], Literal["models"], Dict[str, gr.Blocks]],accept_token: bool = False,**kwargs,) -> gr.Blocks:6 unmodified linescolumns = []for model_name in models:with gr.Column(visible=model_name == default_model) as column:if isinstance(src, dict):src[model_name].render()else:gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs)columns.append(column)model.change(
app.py+37-99
utils.py+6-4