Skip to content

Instantly share code, notes, and snippets.

View cgpeter96's full-sized avatar
๐Ÿ™
Everything is OK!

Peter Chan cgpeter96

๐Ÿ™
Everything is OK!
  • China
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active June 16, 2025 05:05
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@icemelon
icemelon / optimize_bert.py
Last active December 29, 2022 04:09
Optimize the BERT model on CPUs
import time
import argparse
import numpy as np
import mxnet as mx
import gluonnlp as nlp
import tvm
from tvm import relay
import tvm.contrib.graph_runtime as runtime
def timer(thunk, repeat=1, number=10, dryrun=3, min_repeat_ms=1000):
@luistung
luistung / tokenization.cpp
Created October 11, 2019 12:02
c++ version of bert tokenize
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <boost/algorithm/string.hpp>
#include <utf8proc.h>
//https://unicode.org/reports/tr15/#Norm_Forms
//https://ssl.icu-project.org/apiref/icu4c/uchar_8h.html
@fancyerii
fancyerii / ImportModelTest.java
Last active October 24, 2022 14:24
Load Tensorflow Model in Java
package com.easemob.ai.robotapi.test.tensorflow;
import org.tensorflow.SavedModelBundle;
import org.tensorflow.Session;
import org.tensorflow.Tensor;
public class ImportModelTest {
public static void main(String[] args) {
try (SavedModelBundle b = SavedModelBundle.load("/home/mc/data/test-tensorflow/model", "serve")) {
@l0ki000
l0ki000 / csd-wrapper.sh
Last active March 7, 2025 10:14 — forked from zer4tul/gist:6477470
Cisco Anyconnect CSD wrapper for OpenConnect (exhanced to autodownload and autoupdate hostscan)
#!/bin/bash
# Cisco Anyconnect CSD wrapper for OpenConnect
# Enter your vpn host here
CSD_HOSTNAME=
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi