File size: 334 Bytes
0bd62e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr

def longest_word(text):
    words = text.split(" ")
    lengths = [len(word) for word in words]
    return max(lengths)

ex = "The quick brown fox jumped over the lazy dog."

demo = gr.Interface(
    longest_word, "textbox", "label", examples=[[ex]]
)

if __name__ == "__main__":
    demo.launch()