code: def exact_match_reward(responses, answers=None):
      """Reward if generated response contains correct answer."""
      rewards = []
      for response, answer in zip(responses, answers):
          reward = 0.0
          for a in answer:
              if a.lower() in response.lower():
                  reward += 1.0
                  break
          rewards.append(torch.tensor(reward))
      return rewards
  
file_path: trl/examples/research_projects/tools/triviaqa.py
imports: import os
  from dataclasses import dataclass, field
  from typing import Optional
  import torch
  from datasets import load_dataset
  from peft import LoraConfig
  from transformers import AutoTokenizer, HfArgumentParser, load_tool
  from trl import AutoModelForCausalLMWithValueHead, PPOConfig, PPOTrainer, TextEnvironment
label_desc: Use image node_id 3 for calling a global function with example usage: exact_match_reward(responses, answers) and returns: rewards