other formatting text
Browse files- language.py +3 -3
language.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
print('###### LANGUAGES ######')
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
-
def longText(answere, question):
|
5 |
|
|
|
6 |
print(answere)
|
7 |
print(question)
|
8 |
|
9 |
-
input_text = "i have a question and answer.\nthe question is :
|
10 |
print(input_text)
|
11 |
|
12 |
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
|
@@ -15,4 +15,4 @@ def longText(answere, question):
|
|
15 |
outputs = model.generate(input_ids)
|
16 |
|
17 |
print(tokenizer.decode(outputs[0]))
|
18 |
-
return tokenizer.decode(outputs[0])
|
|
|
1 |
print('###### LANGUAGES ######')
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
|
|
4 |
|
5 |
+
def longText(answere, question):
|
6 |
print(answere)
|
7 |
print(question)
|
8 |
|
9 |
+
input_text = " i have a question and answer.\nthe question is : {}\n the response is : {}\n with this information, can you create an answer phrase?".format(question, answere)
|
10 |
print(input_text)
|
11 |
|
12 |
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
|
|
|
15 |
outputs = model.generate(input_ids)
|
16 |
|
17 |
print(tokenizer.decode(outputs[0]))
|
18 |
+
return tokenizer.decode(outputs[0])
|