Spaces:
Sleeping
Sleeping
Update word_counter.py
Browse files- word_counter.py +3 -3
word_counter.py
CHANGED
@@ -3,11 +3,11 @@ from transformers import Tool
|
|
3 |
|
4 |
class WordCounterTool(Tool):
|
5 |
name = "word_counter"
|
6 |
-
description = "This
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
-
def __call__(self,
|
11 |
-
words =
|
12 |
return len(words)
|
13 |
|
|
|
3 |
|
4 |
class WordCounterTool(Tool):
|
5 |
name = "word_counter"
|
6 |
+
description = "This tool counts the words of a text."
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
+
def __call__(self, text: str):
|
11 |
+
words = text.split(" ")
|
12 |
return len(words)
|
13 |
|