Spaces:
Runtime error
Runtime error
Rename word_counter.py to sentence_counter.py
Browse files
word_counter.py → sentence_counter.py
RENAMED
@@ -1,13 +1,13 @@
|
|
1 |
from transformers import AutoTokenizer
|
2 |
from transformers import Tool
|
3 |
|
4 |
-
class
|
5 |
-
name = "
|
6 |
-
description = "This is a tool for counting
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
def __call__(self, prompt: str):
|
11 |
-
|
12 |
-
return len(
|
13 |
|
|
|
1 |
from transformers import AutoTokenizer
|
2 |
from transformers import Tool
|
3 |
|
4 |
+
class SentenceCounterTool(Tool):
|
5 |
+
name = "sentence_counter"
|
6 |
+
description = "This is a tool for counting sentences of an input."
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
def __call__(self, prompt: str):
|
11 |
+
sentences = str.split(". ")
|
12 |
+
return len(sentences)
|
13 |
|