Vladt-Tempest commited on
Commit
56bc197
·
1 Parent(s): 8ab45ac
Files changed (2) hide show
  1. app.py +20 -4
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,7 +1,23 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
 
 
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ def letter_counter(word, letter):
4
+ """Count the occurrences of a specific letter in a word.
5
+
6
+ Args:
7
+ word: The word or phrase to analyze
8
+ letter: The letter to count occurrences of
9
+
10
+ Returns:
11
+ The number of times the letter appears in the word
12
+ """
13
+ return word.lower().count(letter.lower())
14
 
15
+ demo = gr.Interface(
16
+ fn=letter_counter,
17
+ inputs=["text", "text"],
18
+ outputs="number",
19
+ title="Letter Counter",
20
+ description="Count how many times a letter appears in a word"
21
+ )
22
+
23
+ demo.launch(mcp_server=True)
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio[mcp]