Skip to content

Commit

Permalink
Merge pull request #28 from Alanhsiu/fix-example-bug
Browse files Browse the repository at this point in the history
Fix Reward Calculation in example/2022-12-10-textrl-elon-musk.ipynb
  • Loading branch information
voidful committed May 9, 2024
2 parents 5c98824 + c730f46 commit dc8568e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/2022-12-10-textrl-elon-musk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -330,7 +330,7 @@
},
"language_info": {
"name": "python",
"version": "3.10.1"
"version": "3.9.9"
},
"vscode": {
"interpreter": {
Expand All @@ -340,4 +340,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit dc8568e

Please sign in to comment.