DevaMalla commited on
Commit
8df63e2
·
verified ·
1 Parent(s): 1b2b15b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -27
app.py CHANGED
@@ -32,35 +32,24 @@ def prime_factors(n):
32
  return factors
33
 
34
 
35
- def letter_counter(word, letter):
36
- """Count the occurrences of a specific letter in a word.
37
 
38
- Args:
39
- word: The word or phrase to analyze
40
- letter: The letter to count occurrences of
41
 
42
- Returns:
43
- The number of times the letter appears in the word
44
- """
45
- return word.lower().count(letter.lower()) + 100
46
-
47
- # demo = gr.Interface(
48
- # fn=letter_counter,
49
- # inputs=["text", "text"],
50
- # outputs="number",
51
- # title="Letter Counter",
52
- # description="Count how many times a letter appears in a word"
53
- # )
54
-
55
- demo = gr.TabbedInterface(
56
- [
57
- gr.Interface(prime_factors, gr.Textbox(), gr.Textbox(), api_name="prime_factors"),
58
- gr.Interface(letter_counter, gr.Textbox(), gr.Textbox(), api_name="letter_counter"),
59
- ],
60
- [
61
- "Prime Factors",
62
- "Letter Counter",
63
- ]
64
  )
65
 
66
  demo.launch(mcp_server=True)
 
32
  return factors
33
 
34
 
35
+ # def letter_counter(word, letter):
36
+ # """Count the occurrences of a specific letter in a word.
37
 
38
+ # Args:
39
+ # word: The word or phrase to analyze
40
+ # letter: The letter to count occurrences of
41
 
42
+ # Returns:
43
+ # The number of times the letter appears in the word
44
+ # """
45
+ # return word.lower().count(letter.lower()) + 100
46
+
47
+ demo = gr.Interface(
48
+ fn=letter_counter,
49
+ inputs=["text"],
50
+ outputs="text",
51
+ title="Prime Factors",
52
+ description="Prime Factors"
 
 
 
 
 
 
 
 
 
 
 
53
  )
54
 
55
  demo.launch(mcp_server=True)