Skip to content

Instantly share code, notes, and snippets.

View zengjixiang's full-sized avatar

zengjixiang

  • Taiwan
View GitHub Profile
@KohakuBlueleaf
KohakuBlueleaf / grpo.py
Last active April 29, 2025 11:34
10% gsm-8k acc gain within 15min
## Note
## if use vllm in same gpu, remember to set a low gpu_memory_utilization to avoid OOM
## For larger model please consider to use multi-GPU or CPU offloading
## AnySchedule: https://github.com/KohakuBlueleaf/AnySchedule
## LyCORIS: https://github.com/KohakuBlueleaf/LyCORIS
## Following code can perform reasonable training on Llama-3.2-1B-Instruct model with GSM8K dataset
## With noticable improvement on each reward function
from itertools import chain
import re
@willccbb
willccbb / grpo_demo.py
Last active April 28, 2025 01:48
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@sudarshan-koirala
sudarshan-koirala / privateGPT_uichat.py
Created May 15, 2023 14:05
Gradio UI part of the privateGPT github repo
# Disclamer: This code is not written by me. Its taken from https://github.com/imartinez/privateGPT/pull/91.
# All credit goes to `vnk8071` as I mentioned in the video.
# As this code was still in the pull request while I was creating the video, did some modifications so that it works for me locally.
import gradio as gr
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.chains import RetrievalQA
from langchain.embeddings import LlamaCppEmbeddings
from langchain.llms import GPT4All, LlamaCpp
from langchain.vectorstores import Chroma
@ayebrian
ayebrian / vmware.md
Last active April 24, 2025 13:26
CONTENT REMOVED

Content removed in accordance with GitHub's Terms of Service.

Thank you for your understanding.

@taskylizard
taskylizard / fmhy.md
Last active April 28, 2025 02:27
/r/freemediaheckyeah, in one single file (view raw)
@doggy8088
doggy8088 / en-zh-bookmarklet.user.js
Created October 3, 2021 06:48
中、英文網頁切換的瀏覽器書籤小工具 (Tampermonkey Userscript)
// ==UserScript==
// @name 中、英文網頁切換的瀏覽器書籤小工具
// @namespace https://blog.miniasp.com/
// @version 0.1
// @description 按下 Alt+s 就會自動將目前網頁切換至中文或英文版
// @license MIT
// @homepage https://blog.miniasp.com/
// @homepageURL https://blog.miniasp.com/
// @website https://www.facebook.com/will.fans
// @source https://github.com/miniasp/en-zh-bookmarklet
@h-enk
h-enk / hyas-ci.yml
Last active November 24, 2021 00:32
Continuous Integration workflow for your Hyas project
name: Hyas CI
on:
push:
branches: master
pull_request:
branches: master
jobs:
build:
How to install Windows 10 to an external drive has be answered may times here at Ask Different. Most notably Is it possible to use Boot Camp with Windows 10 from an external HDD?. Enough subtle changes have been made to macOS and Windows 10, that I felt the answer should be reposted. Here, I try to incorporate the best ideas in all the other answers I have read. This answer does not require a virtual machine, optical (DVD) drive or any flash drives.
Note: When this answer was tested on a 2018 Mac mini with the T2 chip, Secure Boot and External Boot was set, as shown below. For instruction on how to configure a Mac with the T2 chip, see the Apple website About Secure Boot.
1 Download the latest Windows 10 ISO file from the Microsoft website Download Windows 10 Disc Image (ISO File). Currently this would be 1909 (September 2019) update.
2 Download Window Support Software. Open the Boot Camp Assistant application. From the menu bar, select Action->Download Windows Support Software. By Default, the files sho
@tivrfoa
tivrfoa / basic-maven-pom-junit-5-jupiter-java-11.xml
Created September 1, 2020 14:50
Simple maven pom.xml using JUnit 5 Jupiter and Java 11
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lsc.tests</groupId>
<artifactId>min-maven-pom</artifactId>
<version>1</version>
@oofnikj
oofnikj / answerfile
Last active April 22, 2025 09:28
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"