Skip to content

Instantly share code, notes, and snippets.

@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 3, 2024 11:43
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@joyrexus
joyrexus / README.md
Last active May 3, 2024 11:41
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

@prasathmani
prasathmani / upload-to-google-drive.py
Last active May 3, 2024 11:40
upload files to google drive using python
import requests, json
# Get refresh token from google drive api
# Generating a refresh token for DRIVE API calls using the OAuth playground
# https://www.youtube.com/watch?v=hfWe1gPCnzc
def getToken():
oauth = 'https://www.googleapis.com/oauth2/v4/token' # Google API oauth url
headers = {'content-type': 'application/x-www-form-urlencoded'}
data = {
'grant_type': 'refresh_token',
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@c22dev
c22dev / DEPSteps.md
Last active May 3, 2024 11:36
Remove MDM & DEP from an Apple Sillicon Mac (Sonoma)

How to make an MDM Mac shine like it's brand new ?

Works, as of 14/04/2024, on macOS 14.4.1 and lower (prob higher but idk)

This was made for Apple Sillicon Macs.

Restore Process

You need another Mac for this.

If you don't have one and have recovery locked, it's not possible.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@Artefact2
Artefact2 / README.md
Last active May 3, 2024 11:33
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

  • Disable git hooks
git config core.hooksPath no-hooks
  • Re-enable git hooks
git config --unset core.hooksPath
@sigridjineth
sigridjineth / tcopl_deepmind.md
Created February 11, 2024 02:29
Training Compute-Optimal Large Language Models - DeepMind

2편: ‘모델 크기’와 ‘학습 토큰 수’의 적절한 비율은? | NeurIPS 2022 | 김택민

2편: ‘모델 크기’와 ‘학습 토큰 수’의 적절한 비율은? | NeurIPS 2022 | 김택민

Gopher만큼 계산량이 있다면 63B → 1.4T에서 학습하는 것이 최적이라고 한다. 실제 현업에서는 관점 2가 조금 더 현실성이 있는데, pretrain을 하기 전에 이미 GPU를 사용했으므로 계산량이 고정되어 있는 상태. 최고의 정확도를 내기 위해서 모델 크기를 어떻게 조정해야 하는지 그래프를 통해서 결론을 낼 수 있을 것이다. 안드레 카파시도 nanoGPT에서 관점 2를 좋아한다고 언급했다.

Figure 3 > Figure 2 더 이해하기 편하다.

관점 1과 관점 2에서 얻은 데이터를 조금 더 잘 해석하는 방향으로 제안하는 것인데, 우리가 데이터 포인트를 400개 모았는데 최종 로스를 예측할 수 있는 모델을 만들면 어떨까? 라는 생각이고 샘 알트만도 내부 인터뷰를 통해서 최초 학습 조금 하면 최종 로스를 알 수 있다는 내용 말했음. 로스 예측 모델을 잘 이야기하면 모델 크기는 얼마나 되어야 하고 데이터셋은 얼마나 필요한지 잘 예측할 수 있을 것이다. GPU 스케줄링이 쉬워진다던지, 이 사람에게 몇 대를 빌려주면 되는지 등 잘 빌려주는 것이 좋을 수 있다. 저자들은 로스 예측 모델을 저렇게 생길 수 있지 않을까? 이야기했고. L-BFGS 알고리즘을 이용해서 Huber 로스를 최소화하는 방향으로 학습하면 파라미터를 채울 수 있다고 한다.

@Andrey2G
Andrey2G / encoding.txt
Last active May 3, 2024 11:26
Video Encoding with multiple resolutions
ffmpeg -i "c:/videos/sample.mp4
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v libx264 -crf 22 -c:a aac -ar 48000
-filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k
-filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k
-filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p"
-preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3
-hls_flags independent_segments -master_pl_name "name-pl.m3u8"
"c:/videos/encoded/name-%v.m3u8"