dylanebert HF Staff commited on
Commit
be323fc
·
verified ·
1 Parent(s): 692d0d2

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +3 -9
  2. app.py +23 -0
README.md CHANGED
@@ -1,12 +1,6 @@
1
  ---
2
- title: Letter Counter Mcp
3
- emoji: 💻
4
- colorFrom: indigo
5
- colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 5.29.0
8
  app_file: app.py
9
- pinned: false
 
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)