Skip to content

Instantly share code, notes, and snippets.

View amirrezasalimi's full-sized avatar
🌍
Working

Amirreza salimi amirrezasalimi

🌍
Working
View GitHub Profile
@mlabonne
mlabonne / finetune_llama2.py
Last active January 22, 2025 15:02
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (
@mattiasarro
mattiasarro / rwkv.py
Last active March 30, 2025 15:06
RWKV MVP
# Taken from https://johanwind.github.io/2023/03/23/rwkv_details.html.
# I've added additional comments restructured it a tiny bit, which makes it clearer for me.
import numpy as np
from torch import load as torch_load # Only for loading the model weights
from tokenizers import Tokenizer
exp = np.exp
layer_norm = lambda x, w, b : (x - np.mean(x)) / np.std(x) * w + b
sigmoid = lambda x : 1/(1 + exp(-x))
@bbangert
bbangert / customer.adapter.ts
Created September 3, 2020 19:00
Customized message dispatch/handler for NestJS WS
import { WsAdapter } from '@nestjs/platform-ws';
import { MessageMappingProperties } from '@nestjs/websockets';
import { EMPTY as empty, Observable } from 'rxjs';
export class CustomWsAdapter extends WsAdapter {
public bindMessageHandler(
buffer: any,
handlers: MessageMappingProperties[],
transform: (data: any) => Observable<any>,
): Observable<any> {
@SMUsamaShah
SMUsamaShah / List of JavaScript GUI libraries.md
Last active March 21, 2025 20:44
dat.gui alternatives to create GUI from JavaScript object

JavaScript GUI libraries

These libraries can be used to quickly create a GUI for configureable parameters using sliders, checkboxes, colors pickers etc

  1. Tweakpane https://github.com/cocopon/tweakpane Demo: https://cocopon.github.io/tweakpane/
  2. control-panel https://github.com/freeman-lab/control-panel
  3. ControlKit https://github.com/automat/controlkit.js
  4. guify https://github.com/colejd/guify Main site is down, here is the demo https://jons.website/projects/guify/index
  5. oui https://github.com/wearekuva/oui
  6. Palette.js https://github.com/lehni/palette.js
@izzi-ink
izzi-ink / .block
Created June 24, 2018 16:27 — forked from starcalibre/.block
Westworld Host Personality Chart
height: 600
scrolling: no
border: yes
@herotux
herotux / vps-django.md
Last active January 25, 2023 13:29
راه اندازی وب سرور پایتون و جنگو روی vps

راه اندازی وب سرور پایتون و جنگو روی vps

این یه مقاله کامل نیست و احتمالا پر اشتباه باشه پس اگه میبینید جایی ایراد داره اطلاع بدید ممنونم.

سیستم عامل گنو/لینوکس اوبونتو