Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji: 💻
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: indigo
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 5.29.0
|
8 |
app_file: app.py
|
9 |
-
|
|
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: letter-counter-mcp
|
|
|
|
|
|
|
|
|
|
|
3 |
app_file: app.py
|
4 |
+
sdk: gradio
|
5 |
+
sdk_version: 5.28.0
|
6 |
---
|
|
|
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def letter_counter(word, letter):
|
5 |
+
"""Count the occurrences of a specific letter in a word.
|
6 |
+
|
7 |
+
Args:
|
8 |
+
word: The word or phrase to analyze
|
9 |
+
letter: the letter to count occurrences of
|
10 |
+
|
11 |
+
Return:
|
12 |
+
The number of times the letter appears in the word
|
13 |
+
"""
|
14 |
+
return word.lower().count(letter.lower())
|
15 |
+
|
16 |
+
|
17 |
+
demo = gr.Interface(
|
18 |
+
fn=letter_counter,
|
19 |
+
inputs=["text", "text"],
|
20 |
+
outputs="number"
|
21 |
+
)
|
22 |
+
|
23 |
+
demo.launch(mcp_server=True)
|