aliabd commited on
Commit
970f9da
·
1 Parent(s): c56877f

Upload with huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +6 -6
  2. __pycache__/run.cpython-36.pyc +0 -0
  3. app.py +18 -0
README.md CHANGED
@@ -1,12 +1,12 @@
 
1
  ---
2
- title: Longest Word
3
- emoji:
4
- colorFrom: blue
5
- colorTo: gray
6
  sdk: gradio
7
  sdk_version: 3.3.1
 
8
  app_file: app.py
9
  pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
  ---
3
+ title: longest_word
4
+ emoji: 🔥
5
+ colorFrom: indigo
6
+ colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.3.1
9
+
10
  app_file: app.py
11
  pinned: false
12
  ---
 
 
__pycache__/run.cpython-36.pyc ADDED
Binary file (704 Bytes). View file
 
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+ def longest_word(text):
5
+ words = text.split(" ")
6
+ lengths = [len(word) for word in words]
7
+ return max(lengths)
8
+
9
+
10
+ ex = "The quick brown fox jumped over the lazy dog."
11
+
12
+ demo = gr.Interface(
13
+ longest_word, "textbox", "label", interpretation="default", examples=[[ex]]
14
+ )
15
+
16
+
17
+ if __name__ == "__main__":
18
+ demo.launch()