Skip to content

Instantly share code, notes, and snippets.

View venturaEffect's full-sized avatar
🕳️
rabbit_holes

Cesar Romero venturaEffect

🕳️
rabbit_holes
  • moving, remote work
View GitHub Profile
@venturaEffect
venturaEffect / grpo_demo.py
Created January 31, 2025 22:27 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# 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
@venturaEffect
venturaEffect / README.md
Created December 10, 2024 01:41 — forked from disler/README.md
Use Meta Prompting to rapidly generate results in the GenAI Age

Meta Prompting

In the Generative AI Age your ability to generate prompts is your ability to generate results.

Guide

Claude 3.5 Sonnet and o1 series models are recommended for meta prompting.

Replace {{user-input}} with your own input to generate prompts.

Use mp_*.txt as example user-inputs to see how to generate high quality prompts.

@venturaEffect
venturaEffect / customizations.php
Created October 6, 2021 11:08
something like this?
/**
* This recipe restricts all content of a Custom Post Type (CPT)
* to members only.
*
* This recipe assumes your CPT name is "recipe".
* You should replace this with your CPT name for the filter name
* and the $my_cpt variable's value.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
<?php
/**
* Astra Child Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Astra Child
* @since 1.0.0
*/
<?php
/**
* Template Name: User Profile
*
* Allow users to update their profiles from Frontend.
*
*/
if ( ! defined( 'ABSPATH' ) ) {
function posts_by_modification_date($query) {
if(is_archive() || is_home() || is_front_page()) {
$query->set('orderby', 'modified');
}
}
add_filter('pre_get_posts', 'posts_by_modification_date');
/**
* The function some_kind_of_pmpro_redirection is an arbitrary name given to the
* function created to run this specific bit of code. You can name it anything
* meaningful that you like, assuming that it is unique to the code on the site.
*
* The name of the filter hook, however, is not arbitrary as this is something
* created by the PMPro plugin. In this case, pmpro_confirmation_url, tells
* WordPress when to run this code in the some_kind_of_pmpro_redirection function.
*
* For this to run properly, WordPress requires that you have 3 arguments specified:
UPDATE wp_pmpro_memberships_users SET enddate = DATE_ADD(enddate, interval 6 MONTH) WHERE status = 'active' AND membership_id = 5;