Deleted demo app
Browse files- demo_app.py +0 -27
demo_app.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
def letter_counts(word: str, letter: str):
|
| 5 |
-
"""
|
| 6 |
-
Count the occurrences of a word in a letter.
|
| 7 |
-
|
| 8 |
-
Args:
|
| 9 |
-
word: The word or phrase to analyze.
|
| 10 |
-
letter: The letter to count occurrences of.
|
| 11 |
-
|
| 12 |
-
Returns:
|
| 13 |
-
The number of times the letter appears in the word.
|
| 14 |
-
"""
|
| 15 |
-
assert len(letter) == 1, "The letter should only be one character."
|
| 16 |
-
return word.lower().count(letter.lower())
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
demo = gr.Interface(
|
| 20 |
-
fn=letter_counts,
|
| 21 |
-
inputs=['text', 'text'],
|
| 22 |
-
outputs='number',
|
| 23 |
-
title="Letter Counter",
|
| 24 |
-
description="Count how many times a latter appears in a word."
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
demo.launch(mcp_server=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|