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 |
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
| [ | |
| { | |
| "id": 285714, | |
| "title":"A guide through the Old Testament", | |
| "description":"An insightful guide that walks readers through the key themes and stories of the Old Testament, providing context and interpretation.", | |
| "author":"Celia Brewer Marshall", | |
| "picture":{ | |
| "url":"//covers.openlibrary.org/b/id/577047-S.jpg" | |
| } | |
| }, |
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 Foundation | |
| struct User: Codable { | |
| var username: String | |
| var email: String | |
| } | |
| struct Comment: Codable { | |
| var text: String | |
| var date: Date |
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
| // The Proxy is configurated but the code isn't using it somehow. | |
| // You can verify this by changing the kCFNetworkProxiesHTTPProxy and kCFNetworkProxiesHTTPPort values, | |
| // and you're going to get the same output when you expect it'd fail. | |
| url request = Optional("https://ip.seeip.org/jsonip") | |
| headers request = Optional(["Accept": "application/json"]) | |
| response = Optional(<NSHTTPURLResponse: 0x6000032aca60> { URL: https://ip.seeip.org/jsonip } { Status Code: 200, Headers { | |
| Connection = ( | |
| close | |
| ); |