From c730f468b29af622b0d79493d824584ff39ce503 Mon Sep 17 00:00:00 2001 From: Alanhsiu Date: Thu, 9 May 2024 13:48:52 +0800 Subject: [PATCH] fix bug for reward function --- example/2022-12-10-textrl-elon-musk.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/2022-12-10-textrl-elon-musk.ipynb b/example/2022-12-10-textrl-elon-musk.ipynb index d8bbf00..44f8c5f 100644 --- a/example/2022-12-10-textrl-elon-musk.ipynb +++ b/example/2022-12-10-textrl-elon-musk.ipynb @@ -181,7 +181,7 @@ " if finish or len(predicted_list) >= self.env_max_length:\n", " predicted_text = tokenizer.convert_tokens_to_string(predicted_list[0])\n", " # sentiment classifier\n", - " reward = sentiment(input_item[0]+predicted_text)[0][0]['score'] * 10\n", + " reward = sentiment(input_item['input']+predicted_text)[0][0]['score'] * 10\n", " return reward" ] }, @@ -330,7 +330,7 @@ }, "language_info": { "name": "python", - "version": "3.10.1" + "version": "3.9.9" }, "vscode": { "interpreter": { @@ -340,4 +340,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}