This is a very good place to write a math.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # train_grpo.py | |
| import re | |
| import torch | |
| from datasets import load_dataset, Dataset | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import LoraConfig | |
| from trl import GRPOConfig, GRPOTrainer | |
| # Load and prep dataset |
Find any issues in my Rust code based on the error message and the current code.
[Error message]
Line 40: Char 13: error: cannot assign to tmp because it is borrowed (solution.rs)
|
40 | tmp = curr.as_mut().unwrap().next.take();
| ^^^ tmp is assigned to here but it was already borrowed
41 | curr = &mut tmp;
| -------- tmp is borrowed here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pickle | |
| # TicTacToe game has nine stateus with nine actions. An user can put his ston on any postion in the borad except | |
| def set_state_inplace(S, action, P_no): | |
| ''' S is numpy array.''' | |
| assert S[action] == 0, 'position should be empty to put a new stone' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LinkedList: | |
| def __init__(self, d): | |
| self.d = d | |
| self.r = None | |
| def append(self, d): | |
| self.r = LinkedList(d) | |
| def print_list(alist): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder