Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,35 +32,24 @@ def prime_factors(n):
|
|
| 32 |
return factors
|
| 33 |
|
| 34 |
|
| 35 |
-
def letter_counter(word, letter):
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 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)
|