add new gemini model
Browse filesFiles changed (4)
- app.py+21-22
- app_gemini_coder.py+1-1
- pyproject.toml+1-1
- requirements.txt+76-5
123456778910112 unmodified lines14151617181920212223242526272829303132333435362537383940412728293031323334353637424340414243444546474445464748492 unmodified lines5253545655from app_huggingface import demo as demo_huggingfacefrom app_gemini_coder import demo as demo_geminifrom utils import get_appimport gradio as gr
# Create mapping of providers to their code snippetsPROVIDER_SNIPPETS = {"Hugging Face": """ "Hugging Face": """import gradio as grimport ai_gradiogr.load(2 unmodified lines coder=True, provider="together").launch()""", "Gemini Coder": """import gradio as grimport ai_gradiogr.load( name='gemini:gemini-2.5-pro-exp-03-25', src=ai_gradio.registry, coder=True, provider="together").launch() """,}# Create mapping of providers to their demosPROVIDERS = { "Hugging Face": demo_huggingface, "Gemini Coder": demo_gemini,}
# Modified get_app implementationdemo = gr.Blocks()with demo: gr.Markdown("# Anychat") gr.Markdown("#Anycoder")
provider_dropdown = gr.Dropdown(choices=list(PROVIDERS.keys()), value="Hugging Face", label="Select code snippet") code_display = gr.Code(label="Provider Code Snippet", language="python", value=PROVIDER_SNIPPETS["Hugging Face"])
provider_dropdown = gr.Dropdown( choices=list(PROVIDERS.keys()), value="Hugging Face", label="Select code snippet" ) code_display = gr.Code( label="Provider Code Snippet", language="python", value=PROVIDER_SNIPPETS["Hugging Face"] ) def update_code(provider): return PROVIDER_SNIPPETS.get(provider, "Code snippet not available") provider_dropdown.change( fn=update_code, inputs=[provider_dropdown], outputs=[code_display] )
provider_dropdown.change(fn=update_code, inputs=[provider_dropdown], outputs=[code_display])
selected_demo = get_app( models=list(PROVIDERS.keys()), default_model="Hugging Face",2 unmodified lines )
if __name__ == "__main__": demo.queue(api_open=False).launch(show_api=False) demo.queue(api_open=False).launch(show_api=False)10 unmodified lines111213141415161710 unmodified lines# Create and launch the interface using get_app utilitydemo = get_app( models=GEMINI_MODELS_FULL, # Use the full names with prefix default_model=GEMINI_MODELS_FULL[-2], default_model=GEMINI_MODELS_FULL[0], dropdown_label="Select Gemini Model", choices=GEMINI_MODELS_DISPLAY, # Display names without prefix src=ai_gradio.registry,4 unmodified lines56788910114 unmodified linesreadme = "README.md"requires-python = ">=3.10"dependencies = [ "ai-gradio[huggingface]==0.2.54", "ai-gradio[huggingface, gemini]==0.2.55",]
[tool.uv.sources]1 unmodified line2345567828 unmodified lines373839404142434442 unmodified lines878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201215 unmodified lines12712812913013113213313413513613713813914014114214314414514614714889 unmodified lines2382392402412422432443 unmodified lines24824925021121225125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028111 unmodified lines2932942952962972982993009 unmodified lines31031131231331431531631731831932032132232332436 unmodified lines3613623633643652993663673683692 unmodified lines3723733743753763773789 unmodified lines3883893903913923933943953963273973983994004014024031 unmodified line# uv pip compile pyproject.toml -o requirements.txtaccelerate==1.5.2 # via ai-gradioai-gradio==0.2.54ai-gradio==0.2.55 # via anychat (pyproject.toml)aiofiles==23.2.1 # via gradio28 unmodified lines # via aiortcbitsandbytes==0.42.0 # via ai-gradiocachetools==5.5.2 # via google-authcertifi==2025.1.31 # via # httpcore42 unmodified lines # gradio-client # huggingface-hub # torchgoogle-ai-generativelanguage==0.6.15 # via google-generativeaigoogle-api-core==2.24.2 # via # google-ai-generativelanguage # google-api-python-client # google-generativeaigoogle-api-python-client==2.165.0 # via google-generativeaigoogle-auth==2.38.0 # via # google-ai-generativelanguage # google-api-core # google-api-python-client # google-auth-httplib2 # google-genai # google-generativeaigoogle-auth-httplib2==0.2.0 # via google-api-python-clientgoogle-crc32c==1.7.0 # via aiortcgoogle-genai==0.3.0 # via ai-gradiogoogle-generativeai==0.8.4 # via ai-gradiogoogleapis-common-protos==1.69.2 # via # google-api-core # grpcio-statusgradio==5.23.0 # via # ai-gradio5 unmodified lines # via ai-gradiogroovy==0.1.2 # via gradiogrpcio==1.71.0 # via # google-api-core # grpcio-statusgrpcio-status==1.71.0 # via google-api-coreh11==0.14.0 # via # httpcore # uvicornhttpcore==1.0.7 # via httpxhttplib2==0.22.0 # via # google-api-python-client # google-auth-httplib2httpx==0.28.1 # via # gradio89 unmodified linespillow==11.1.0 # via # ai-gradio # google-genai # gradioplatformdirs==4.3.7 # via pooch3 unmodified lines # via # aiohttp # yarlprotobuf==6.30.1 # via onnxruntimeproto-plus==1.26.1 # via # google-ai-generativelanguage # google-api-coreprotobuf==5.29.4 # via # google-ai-generativelanguage # google-api-core # google-generativeai # googleapis-common-protos # grpcio-status # onnxruntime # proto-pluspsutil==7.0.0 # via acceleratepyasn1==0.6.1 # via # pyasn1-modules # rsapyasn1-modules==0.4.1 # via google-authpycparser==2.22 # via cffipydantic==2.10.6 # via # fastapi # google-genai # google-generativeai # gradiopydantic-core==2.27.2 # via pydantic11 unmodified lines # via aiortcpyopenssl==25.0.0 # via aiortcpyparsing==3.2.3 # via httplib2python-dateutil==2.9.0.post0 # via pandaspython-dotenv==1.0.19 unmodified lines # huggingface-hubrequests==2.32.3 # via # google-api-core # google-genai # huggingface-hub # pooch # twiliorich==13.9.4 # via typerrsa==4.9 # via google-authruff==0.11.2 # via gradiosafehttpx==0.1.636 unmodified lines # accelerate # ai-gradiotqdm==4.67.1 # via # google-generativeai # via huggingface-hub # huggingface-hubtwilio==9.5.1 # via ai-gradiotyper==0.15.22 unmodified lines # via # anyio # fastapi # google-generativeai # gradio # gradio-client # huggingface-hub9 unmodified lines # uvicorntzdata==2025.2 # via pandasuritemplate==4.1.1 # via google-api-python-clienturllib3==2.3.0 # via requestsuvicorn==0.34.0 # via gradiowebsockets==15.0.1websockets==14.2 # via # ai-gradio # google-genai # gradio-clientyarl==1.18.3 # via aiohttpapp.py+21-22
app_gemini_coder.py+1-1
pyproject.toml+1-1
requirements.txt+76-5