gradio_app.mdx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ---
  2. title: 'Gradio.app'
  3. description: 'Deploy your RAG application to gradio.app platform'
  4. ---
  5. Embedchain offers a Streamlit template to facilitate the development of RAG chatbot applications in just three easy steps.
  6. Follow the instructions given below to deploy your first application quickly:
  7. ## Step-1: Create RAG app
  8. We provide a command line utility called `ec` in embedchain that inherits the template for `gradio.app` platform and help you deploy the app. Follow the instructions to create a gradio.app app using the template provided:
  9. ```bash Install embedchain
  10. pip install embedchain
  11. ```
  12. ```bash Create application
  13. mkdir my-rag-app
  14. ec create --template=gradio.app
  15. ```
  16. This will generate a directory structure like this:
  17. ```bash
  18. ├── app.py
  19. ├── embedchain.json
  20. └── requirements.txt
  21. ```
  22. Feel free to edit the files as required.
  23. - `app.py`: Contains API app code
  24. - `embedchain.json`: Contains embedchain specific configuration for deployment (you don't need to configure this)
  25. - `requirements.txt`: Contains python dependencies for your application
  26. ## Step-2: Test app locally
  27. You can run the app locally by simply doing:
  28. ```bash Run locally
  29. pip install -r requirements.txt
  30. ec dev
  31. ```
  32. ## Step-3: Deploy to gradio.app
  33. ```bash Deploy to gradio.app
  34. ec deploy
  35. ```
  36. This will run `gradio deploy` which will prompt you questions and deploy your app directly to huggingface spaces.
  37. <img src="/images/gradio_app.png" alt="gradio app" />
  38. ## Seeking help?
  39. If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
  40. <Snippet file="get-help.mdx" />