Update textify_text.py
Browse files- textify_text.py +3 -6
textify_text.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
from transformers import AutoTokenizer
|
| 2 |
from transformers import Tool
|
| 3 |
|
| 4 |
import re,sys,unicodedata
|
|
@@ -146,13 +145,11 @@ class TextifyTextTool(Tool):
|
|
| 146 |
inputs = ["text"]
|
| 147 |
outputs = ["text"]
|
| 148 |
|
| 149 |
-
def __call__(self,
|
| 150 |
docx = TextCleaner()
|
| 151 |
-
docx.text =
|
| 152 |
docx.clean_text()
|
| 153 |
print(docx)
|
| 154 |
-
# token = os.environ['hf']
|
| 155 |
-
tokenizer = AutoTokenizer.from_pretrained("lgaalves/gpt2-dolly")
|
| 156 |
-
tokens = tokenizer(prompt)["input_ids"]
|
| 157 |
return docx.text
|
| 158 |
|
|
|
|
|
|
|
| 1 |
from transformers import Tool
|
| 2 |
|
| 3 |
import re,sys,unicodedata
|
|
|
|
| 145 |
inputs = ["text"]
|
| 146 |
outputs = ["text"]
|
| 147 |
|
| 148 |
+
def __call__(self, text: str):
|
| 149 |
docx = TextCleaner()
|
| 150 |
+
docx.text = text
|
| 151 |
docx.clean_text()
|
| 152 |
print(docx)
|
| 153 |
+
# token = os.environ['hf']
|
|
|
|
|
|
|
| 154 |
return docx.text
|
| 155 |
|