Skip to content

Instantly share code, notes, and snippets.

# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@nandorojo
nandorojo / React Navigation Shared Element Transitions.md
Last active May 6, 2024 16:52
Shared Element Transitions with React Navigation and Expo (2019)

Shared Element Transitions with React Navigation and Expo (2019)

It's 2019, and creating smooth shared element transitions in react native (& expo!) is finally easy.

Ideally, as Pablo Stanley suggests, your app's navigation will use these shared transitions for similar components that appear across screens.

Is it possible to achieve the great experience above using react-native/expo? Now it is.

@An-Toha
An-Toha / ESP32_selftemp_en.ino
Created August 31, 2022 14:02
This is sketch for internal temperature sensor ESP32 CPU. * The main ideas are: * to ignore 53.3 (128 before converting to Celsius); * WiFi must be connected, if else you'll get 53.3 (128) only. * * Tested in AI Thinker ESP32 Cam module. Can be add to standard camera example in Arduino. * While ESP32 Cam module was idle - the temperature was aro…
/*This is sketch for internal temperature sensor ESP32 CPU.
* The main ideas are:
* to ignore 53.3 (128 before converting to Celsius);
* WiFi must be connected, if else you'll get 53.3 (128) only.
*
* Tested in AI Thinker ESP32 Cam module. Can be add to standard camera example in Arduino.
* While ESP32 Cam module was idle - the temperature was around 47*C.
* While camera video stream was on - the temperature was rising to around 57*C.
* See temperature values in serial monitor at 115200.
* Best regards, Anton S
@jinjier
jinjier / 250.csv
Last active May 6, 2024 16:50
JavDB Top 250 movies code list. [Updated at 2024/02]
1 LAFBD-41
2 SSNI-497
3 ABP-984
4 IPX-580
5 IPX-811
6 IPX-177
7 STARS-804
8 SMBD-115
9 ABP-968
10 ABF-017
@psamaan
psamaan / country
Last active May 6, 2024 16:49
Countries Select Option List
<select name="Country">
<option value="" selected="selected">Select Country</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
@gabe565
gabe565 / change-arc-icon.md
Last active May 6, 2024 16:49
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
package de.kuno.listsections
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateRectAsState
import androidx.compose.foundation.ExperimentalFoundationApi
@kodekracker
kodekracker / c++Template.cpp
Last active May 6, 2024 16:48
Basic C++ Template for Competitive Programming
/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
/******** All Required Header Files ********/
@digitalsignalperson
digitalsignalperson / tabs.css
Created January 23, 2024 09:18
obsidian tabs in multiple rows
/* --------------compact tabs--------------------*/
.workspace .mod-root .workspace-tab-header {
width: unset;
max-width: var(--tab-width);
border: 1px solid var(--color-base-50);
}
/*.workspace-tab-header-inner {
width: unset;
}*/