updates
Browse filesFiles changed (2)
- app_allenai.py+8-37
- app_perplexity.py+1-1
123456789101112131415161718192021222324252627282930313233343536373839345678910111213import gradio as grimport spacesimport transformers_gradio
# Load Llama modeldemo = gr.load(name="akhaliq/allen-test", src="spaces")
# Load OLMo modelolmo_demo = gr.load(name="akhaliq/olmo-anychat", src="spaces")
# Disable API names for both demosfor fn in demo.fns.values(): fn.api_name = Falsefor fn in olmo_demo.fns.values(): fn.api_name = False
# Create a dropdown to select the modelwith gr.Blocks() as combined_demo: model_choice = gr.Dropdown( choices=["Llama", "OLMo"], value="Llama", label="Select Model" ) with gr.Tab("Model Interface"): # Create placeholder for the selected model's interface placeholder = gr.HTML() def update_interface(choice): if choice == "Llama": return demo else: return olmo_demo model_choice.change( fn=update_interface, inputs=[model_choice], outputs=[placeholder] )from utils import get_app
# Create the combined demo using the utility functiondemo = get_app( models=["akhaliq/allen-test", "akhaliq/olmo-anychat"], default_model="akhaliq/allen-test", src="spaces")
13 unmodified lines141516171718192013 unmodified lines "llama-3.1-8b-instruct", "llama-3.1-70b-instruct", ], default_model="llama-3.1-sonar-large-128k-online", default_model="llama-3.1-sonar-huge-128k-online", src=perplexity_gradio.registry, accept_token=not os.getenv("PERPLEXITY_API_KEY"),)app_allenai.py+8-37
app_perplexity.py+1-1