Skip to content

Commit 2ef8e25

Browse files
authored
Update gradio-server.mdx: fix issue 19
Huggingfaces space needs an app.py to trigger the build. a temporary fix will be to change the name of the file from server.py to app.py
1 parent c7998ab commit 2ef8e25

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

units/en/unit2/gradio-server.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ pip install "gradio[mcp]" textblob
2626

2727
## Creating the Server
2828

29-
Create a new file called `server.py` with the following code:
29+
> Hugging face spaces needs an app.py file to build the space. So the name of the python file has to be app.py
30+
31+
Create a new file called `app.py` with the following code:
3032

3133
```python
3234
import gradio as gr
@@ -94,7 +96,7 @@ Let's break down the key components:
9496
Start the server by running:
9597

9698
```bash
97-
python server.py
99+
python app.py
98100
```
99101

100102
You should see output indicating that both the web interface and MCP server are running. The web interface will be available at `http://localhost:7860`, and the MCP server at `http://localhost:7860/gradio_api/mcp/sse`.
@@ -166,7 +168,7 @@ textblob
166168
3. Push your code to the Space:
167169
```bash
168170
git init
169-
git add server.py requirements.txt
171+
git add app.py requirements.txt
170172
git commit -m "Initial commit"
171173
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/mcp-sentiment
172174
git push -u origin main
@@ -185,4 +187,4 @@ Now that we have our MCP server running, we'll create clients to interact with i
185187
2. Implement a SmolAgents-based Python client
186188
3. Test both clients with our deployed server
187189

188-
Let's move on to building our first client!
190+
Let's move on to building our first client!

0 commit comments

Comments
 (0)