Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def letter_counter(word, letter):
|
| 4 |
-
"""
|
| 5 |
-
Count the number of occurrences of a letter in a word or text.
|
| 6 |
-
|
| 7 |
-
Args:
|
| 8 |
-
word (str): The input text to search through
|
| 9 |
-
letter (str): The letter to search for
|
| 10 |
-
|
| 11 |
-
Returns:
|
| 12 |
-
int: Number of times the letter appears
|
| 13 |
-
"""
|
| 14 |
word = word.lower()
|
| 15 |
letter = letter.lower()
|
| 16 |
-
|
| 17 |
-
return count
|
| 18 |
|
| 19 |
demo = gr.Interface(
|
| 20 |
fn=letter_counter,
|
|
@@ -25,4 +14,4 @@ demo = gr.Interface(
|
|
| 25 |
)
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
| 28 |
-
demo.launch(
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def letter_counter(word, letter):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
word = word.lower()
|
| 5 |
letter = letter.lower()
|
| 6 |
+
return word.count(letter)
|
|
|
|
| 7 |
|
| 8 |
demo = gr.Interface(
|
| 9 |
fn=letter_counter,
|
|
|
|
| 14 |
)
|
| 15 |
|
| 16 |
if __name__ == "__main__":
|
| 17 |
+
demo.launch(mcp_server=True) # This is the key part to enable MCP
|