Shankarm08 commited on
Commit
fc8aba8
·
verified ·
1 Parent(s): 1e9b343

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
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
- count = word.count(letter)
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(server_port=7860) # No mcp_server here!
 
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