Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -1,23 +1,19 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
|
4 |
-
def letter_counter(word, letter):
|
5 |
-
"""
|
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 |
-
|
19 |
-
|
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)
|
|
|
|
|
|
|
|