Skip to content

Instantly share code, notes, and snippets.

View kaisugi's full-sized avatar

Kaito Sugimoto kaisugi

View GitHub Profile
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active November 18, 2024 00:45
ローカルLLMはこーやって使うの💢
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active September 19, 2024 12:10
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@doraTeX
doraTeX / ocr.sh
Last active October 31, 2024 11:08
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@hppRC
hppRC / install-jumanppv2.sh
Created January 4, 2023 07:07
Juman++ V2のインストール手順
ORIGIN_DIR=$(pwd)
JUMANPP_DIR="$HOME/.local/share/jumanpp"
mkdir -p $JUMANPP_DIR
cd $JUMANPP_DIR
curl -LO https://github.com/ku-nlp/jumanpp/releases/download/v2.0.0-rc3/jumanpp-2.0.0-rc3.tar.xz
tar -xf jumanpp-2.0.0-rc3.tar.xz
cd jumanpp-2.0.0-rc3
@ciamac-da
ciamac-da / gist-06-install-or-update-vscode(Visual Studio Code)-on-debian.txt
Created July 6, 2021 09:01
Install-or-update-vscode(Visual Studio Code)-on-debian
#installing vscode on Debian
You can install vscode using following commands:
1- Start by updating the packages index and installing the dependencies by typing:
sudo apt update
2- sudo apt install software-properties-common apt-transport-https curl
3- Import the Microsoft GPG key using the following curl command:
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
4- Add the Visual Studio Code repository to your system:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
@xuwei-k
xuwei-k / holiday-scala-steward.yml
Created April 9, 2021 07:48
GitHub Actionsで祝日だったらcron実行をskipするサンプル
on:
schedule:
- cron: '0 0 * * *'
jobs:
scala-steward:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
@Yarakashi-Kikohshi
Yarakashi-Kikohshi / latex-physics.md
Created February 9, 2021 07:36
physics パッケージを自分好みに

physics パッケージを自分好みに

physics パッケージは物理で用いられる数学記号等を簡便に利用できるようにxparse パッケージを利用してコマンドを作成している.また,amsmath パッケージにも依存している.

physics.sty | CTAN

目的