Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,13 @@ description = "A State-of-the-Art Large-scale Pretrained Response generation mod
|
|
| 7 |
examples = [["How are you?"]]
|
| 8 |
|
| 9 |
# Set the padding token to be used and initialize the model
|
| 10 |
-
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|
| 11 |
-
|
| 12 |
tokenizer.add_special_tokens({'pad_token': '[EOS]'})
|
| 13 |
tokenizer.pad_token = tokenizer.eos_token
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
#predict
|
| 16 |
def predict(input, history=[]):
|
|
|
|
| 7 |
examples = [["How are you?"]]
|
| 8 |
|
| 9 |
# Set the padding token to be used and initialize the model
|
| 10 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|
| 11 |
+
tokenizer.padding_side = 'left'
|
| 12 |
tokenizer.add_special_tokens({'pad_token': '[EOS]'})
|
| 13 |
tokenizer.pad_token = tokenizer.eos_token
|
| 14 |
+
|
| 15 |
+
# Model
|
| 16 |
+
model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-medium")
|
| 17 |
|
| 18 |
#predict
|
| 19 |
def predict(input, history=[]):
|