Gebruikershulpmiddelen

Site-hulpmiddelen


gradio_project

Gradio project (1)

Gradio project (1)

Terug naar Gradio Start

→ Opzetten van een Gradio project met Python en VS Code als editor

Virtuele omgeving vanuit VS Code

Een Virtuele omgeving creëren vanuit VS Code

  • Open het Command Palette (Ctrl+Shift+P) in VS Code
  • Zoek het “Python: Create Environment” command en selecteer het
  • Kies de aanbevolen Python omgeving
  • Start een app door het start bestand te selecteren en rechts boven de editor op het play knopje te klikken

→ Pakketten toevoegen aan deze omgeving doe je via de terminal in VS Code.

Python environments in VS Code

Gradio Installeren

Gradio project (1)

pip install gradio

Update/Upgrade naar de laatste versie:

pip install --upgrade gradio

Instaleer dotenv om het .env bestand te kunnen lezen zodat daar de systeem variabelen in kunnen

pip install python-dotenv

Applicatie starten met auto reload:

When developing locally, if you want to run the code as a Python script, you can use the Gradio CLI to launch the application in reload mode, which will provide seamless and fast development. Learn more about reloading in the Auto-Reloading Guide.
gradio app.py

Je kunt ook de app starten zonder Auto-Reloading:

python app.py

Je App delen met anderen → publiekelijk:

demo.launch(share=True)

http://localhost:7860 om app de zien


Gradio quickstart
Gradio Docs.


gradio_project.txt · Laatst gewijzigd: 2023/09/17 22:41 door a3dijke