dylanebert's picture
dylanebert HF Staff
Upload folder using huggingface_hub
be323fc verified
raw
history blame
481 Bytes
import gradio as gr
def letter_counter(word, letter):
"""Count the occurrences of a specific letter in a word.
Args:
word: The word or phrase to analyze
letter: the letter to count occurrences of
Return:
The number of times the letter appears in the word
"""
return word.lower().count(letter.lower())
demo = gr.Interface(
fn=letter_counter,
inputs=["text", "text"],
outputs="number"
)
demo.launch(mcp_server=True)