Update modeling_t5.py
Browse files- modeling_t5.py +10 -1
modeling_t5.py
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
class T5ForConditionalGeneration(t5FCG):
|
2 |
|
3 |
def __init__(self, config: T5Config):
|
@@ -42,4 +51,4 @@ class T5ForConditionalGeneration(t5FCG):
|
|
42 |
response = self.get_response(tokenizer,input_text,sample=sample, top_p=top_p, temperature=temperature,max_length=max_length,no_repeat_ngram_size=no_repeat_ngram_size,num_beams=num_beams, length_penalty=length_penalty)
|
43 |
|
44 |
history.append((query, response))
|
45 |
-
return response,history
|
|
|
1 |
+
from transformers import T5ForConditionalGeneration as t5FCG
|
2 |
+
from transformers.models.t5.configuration_t5 import T5Config
|
3 |
+
from typing import Optional, Tuple, Union, List, Callable
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
class T5ForConditionalGeneration(t5FCG):
|
11 |
|
12 |
def __init__(self, config: T5Config):
|
|
|
51 |
response = self.get_response(tokenizer,input_text,sample=sample, top_p=top_p, temperature=temperature,max_length=max_length,no_repeat_ngram_size=no_repeat_ngram_size,num_beams=num_beams, length_penalty=length_penalty)
|
52 |
|
53 |
history.append((query, response))
|
54 |
+
return response,history
|