Spaces:
Sleeping
Sleeping
Update requirements.txt and add app1.py
Browse files- README.md +1 -1
- app1.py +25 -0
- requirements.txt +2 -1
README.md
CHANGED
@@ -5,7 +5,7 @@ colorFrom: yellow
|
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.0.1
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
short_description: minion running in space
|
|
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.0.1
|
8 |
+
app_file: app1.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
short_description: minion running in space
|
app1.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def letter_counter(word, letter):
|
5 |
+
"""Count the occurrences of a specific letter in a word.
|
6 |
+
|
7 |
+
Args:
|
8 |
+
word: The word or phrase to analyze
|
9 |
+
letter: The letter to count occurrences of
|
10 |
+
|
11 |
+
Returns:
|
12 |
+
The number of times the letter appears in the word
|
13 |
+
"""
|
14 |
+
return word.lower().count(letter.lower())
|
15 |
+
|
16 |
+
|
17 |
+
demo = gr.Interface(
|
18 |
+
fn=letter_counter,
|
19 |
+
inputs=["text", "text"],
|
20 |
+
outputs="number",
|
21 |
+
title="Letter Counter",
|
22 |
+
description="Count how many times a letter appears in a word"
|
23 |
+
)
|
24 |
+
|
25 |
+
demo.launch(mcp_server=True)
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
gradio==5.0.1
|
2 |
-
huggingface_hub==0.25.2
|
|
|
|
1 |
gradio==5.0.1
|
2 |
+
huggingface_hub==0.25.2
|
3 |
+
gradio[mcp]
|