repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: 'Huggingface.co' |
| #3 | description: 'Deploy your RAG application to huggingface.co platform' |
| #4 | --- |
| #5 | |
| #6 | With Embedchain, you can directly host your apps in just three steps to huggingface spaces where you can view and deploy your app to the world. |
| #7 | |
| #8 | We support two types of deployment to huggingface spaces: |
| #9 | |
| #10 | <CardGroup cols={2}> |
| #11 | <Card title="" href="#using-streamlit-io"> |
| #12 | Streamlit.io |
| #13 | </Card> |
| #14 | <Card title="" href="#using-gradio-app"> |
| #15 | Gradio.app |
| #16 | </Card> |
| #17 | </CardGroup> |
| #18 | |
| #19 | ## Using streamlit.io |
| #20 | |
| #21 | ### Step 1: Create a new RAG app |
| #22 | |
| #23 | Create a new RAG app using the following command: |
| #24 | |
| #25 | ```bash |
| #26 | mkdir my-rag-app |
| #27 | ec create --template=hf/streamlit.io # inside my-rag-app directory |
| #28 | ``` |
| #29 | |
| #30 | When you run this for the first time, you'll be asked to login to huggingface.co. Once you login, you'll need to create a **write** token. You can create a write token by going to [huggingface.co settings](https://huggingface.co/settings/token). Once you create a token, you'll be asked to enter the token in the terminal. |
| #31 | |
| #32 | This will also create an `embedchain.json` file in your app directory. Add a `name` key into the `embedchain.json` file. This will be the "repo-name" of your app in huggingface spaces. |
| #33 | |
| #34 | ```json embedchain.json |
| #35 | { |
| #36 | "name": "my-rag-app", |
| #37 | "provider": "hf/streamlit.io" |
| #38 | } |
| #39 | ``` |
| #40 | |
| #41 | ### Step-2: Test app locally |
| #42 | |
| #43 | You can run the app locally by simply doing: |
| #44 | |
| #45 | ```bash Run locally |
| #46 | pip install -r requirements.txt |
| #47 | ec dev |
| #48 | ``` |
| #49 | |
| #50 | ### Step-3: Deploy to huggingface spaces |
| #51 | |
| #52 | ```bash Deploy to huggingface spaces |
| #53 | ec deploy |
| #54 | ``` |
| #55 | |
| #56 | This will deploy your app to huggingface spaces. You can view your app at `https://huggingface.co/spaces/<your-username>/my-rag-app`. This will get prompted in the terminal once the app is deployed. |
| #57 | |
| #58 | ## Using gradio.app |
| #59 | |
| #60 | Similar to streamlit.io, you can deploy your app to gradio.app in just three steps. |
| #61 | |
| #62 | ### Step 1: Create a new RAG app |
| #63 | |
| #64 | Create a new RAG app using the following command: |
| #65 | |
| #66 | ```bash |
| #67 | mkdir my-rag-app |
| #68 | ec create --template=hf/gradio.app # inside my-rag-app directory |
| #69 | ``` |
| #70 | |
| #71 | When you run this for the first time, you'll be asked to login to huggingface.co. Once you login, you'll need to create a **write** token. You can create a write token by going to [huggingface.co settings](https://huggingface.co/settings/token). Once you create a token, you'll be asked to enter the token in the terminal. |
| #72 | |
| #73 | This will also create an `embedchain.json` file in your app directory. Add a `name` key into the `embedchain.json` file. This will be the "repo-name" of your app in huggingface spaces. |
| #74 | |
| #75 | ```json embedchain.json |
| #76 | { |
| #77 | "name": "my-rag-app", |
| #78 | "provider": "hf/gradio.app" |
| #79 | } |
| #80 | ``` |
| #81 | |
| #82 | ### Step-2: Test app locally |
| #83 | |
| #84 | You can run the app locally by simply doing: |
| #85 | |
| #86 | ```bash Run locally |
| #87 | pip install -r requirements.txt |
| #88 | ec dev |
| #89 | ``` |
| #90 | |
| #91 | ### Step-3: Deploy to huggingface spaces |
| #92 | |
| #93 | ```bash Deploy to huggingface spaces |
| #94 | ec deploy |
| #95 | ``` |
| #96 | |
| #97 | This will deploy your app to huggingface spaces. You can view your app at `https://huggingface.co/spaces/<your-username>/my-rag-app`. This will get prompted in the terminal once the app is deployed. |
| #98 | |
| #99 | ## Seeking help? |
| #100 | |
| #101 | If you run into issues with deployment, please feel free to reach out to us via any of the following methods: |
| #102 | |
| #103 | <Snippet file="get-help.mdx" /> |
| #104 |