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

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +19 -23
app.py CHANGED
@@ -1,23 +1,19 @@
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)
 
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(fn=letter_counter, inputs=["text", "text"], outputs="number")
18
+
19
+ demo.launch(mcp_server=True)