Update README.md
Browse files
README.md
CHANGED
@@ -14,6 +14,7 @@ def generate_response(input_text):
|
|
14 |
num_return_sequences=1,
|
15 |
no_repeat_ngram_size=2,
|
16 |
pad_token_id=tokenizer.eos_token_id,
|
|
|
17 |
early_stopping=True,
|
18 |
do_sample=True,
|
19 |
use_cache=True,
|
@@ -23,12 +24,7 @@ def generate_response(input_text):
|
|
23 |
|
24 |
bot_response_start = full_generated_text.find('[Bot]') + len('[Bot]')
|
25 |
bot_response = full_generated_text[bot_response_start:]
|
26 |
-
|
27 |
-
last_period_index = bot_response.rfind('.')
|
28 |
-
if last_period_index != -1:
|
29 |
-
bot_response = bot_response[:last_period_index + 1]
|
30 |
-
|
31 |
-
return bot_response.strip()
|
32 |
|
33 |
|
34 |
model_name = 'KhantKyaw/Chat_GPT-2'
|
|
|
14 |
num_return_sequences=1,
|
15 |
no_repeat_ngram_size=2,
|
16 |
pad_token_id=tokenizer.eos_token_id,
|
17 |
+
eos_token_id=tokenizer.eos_token_id,
|
18 |
early_stopping=True,
|
19 |
do_sample=True,
|
20 |
use_cache=True,
|
|
|
24 |
|
25 |
bot_response_start = full_generated_text.find('[Bot]') + len('[Bot]')
|
26 |
bot_response = full_generated_text[bot_response_start:]
|
27 |
+
return bot_response
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
model_name = 'KhantKyaw/Chat_GPT-2'
|