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
| """ | |
| Comparative Analysis of Row Reduction Techniques for Binary Datasets | |
| This script demonstrates and compares various methods for reducing | |
| the number of rows in a binary (0/1) dataset, including sampling, | |
| clustering, dimensionality reduction, aggregation, and anomaly detection. | |
| """ | |
| import numpy as np | |
| import pandas as pd |
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
| // ==UserScript== | |
| // @name Medium Paywall Bypass | |
| // @namespace Violentmonkey Scripts | |
| // @run-at document-start | |
| // @match *://*.medium.com/* | |
| // @match *://medium.com/* | |
| // @match *://*/* | |
| // @grant none | |
| // @version 2.4 | |
| // @inject-into content |
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 asyncio | |
| import concurrent | |
| from concurrent.futures import ThreadPoolExecutor | |
| from contextlib import contextmanager | |
| import sys | |
| import random | |
| import time | |
| import uvloop | |
| asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) |
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
| #!/bin/bash | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### | |
| ### to verify your gpu is cuda enable check |
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 cv2 | |
| import pathlib | |
| import time | |
| import argparse | |
| import os | |
| import glob | |
| # Construct the argument parser. | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('-i', |
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 os | |
| # create a dictionary with file names as keys | |
| # and for each file name the paths where they | |
| # were found | |
| file_paths = {} | |
| for root, dirs, files in os.walk('.'): | |
| for f in files: | |
| if f.endswith('.txt'): | |
| if f not in file_paths: |
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 shutil | |
| import os | |
| import sys | |
| import json | |
| def changeLineForAllTextfiles(path, old_label, new_label): | |
| for root, dirs, files in os.walk(path): | |
| for file in files: | |
| if file.endswith(".txt"): | |
| file_path = os.path.join(root, file) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.