Skip to content

Instantly share code, notes, and snippets.

View avinash-mishra's full-sized avatar
🎯
Focusing

Avinash avinash-mishra

🎯
Focusing
View GitHub Profile
@abhishekkrthakur
abhishekkrthakur / llm_training_sft.py
Created July 16, 2023 09:09
Train LLMs in 50 lines of code. This is a reference code for YouTube tutorial: https://www.youtube.com/watch?v=JNMVulH7fCo&ab_channel=AbhishekThakur
import torch
from datasets import load_dataset
from peft import LoraConfig, get_peft_model, prepare_model_for_int8_training
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments
from trl import SFTTrainer
def train():
train_dataset = load_dataset("tatsu-lab/alpaca", split="train")
tokenizer = AutoTokenizer.from_pretrained("Salesforce/xgen-7b-8k-base", trust_remote_code=True)
@trashvin
trashvin / connect.py
Created January 19, 2020 15:28
Connect to IBM DB2 instance from Jupyter Notebook using Python
import ibm_db
dsn_hostname = "dashdb-txn-sbox-yp-dal09-04.services.dal.bluemix.net" # e.g.: "dashdb-txn-sbox-yp-dal09-04.services.dal.bluemix.net"
dsn_uid = "121a1we" # e.g. "abc12345"
dsn_pwd = "xfgfdg121212" # e.g. "7dBZ3wWt9XN6$o0J"
dsn_driver = "{IBM DB2 ODBC DRIVER}"
dsn_database = "BLUDB" # e.g. "BLUDB"
dsn_port = "50000" # e.g. "50000"
dsn_protocol = "TCPIP" # i.e. "TCPIP"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sundowndev
sundowndev / GoogleDorking.md
Last active October 6, 2024 12:57
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@jonlabelle
jonlabelle / docker_compose_cheatsheet.md
Last active October 7, 2024 06:51
Docker Compose Cheatsheet
@tsuemura
tsuemura / ja-SR.js
Last active November 16, 2019 06:52
CodeceptJS神龍語翻訳ファイル
module.exports = {
I: '我が名は神龍',
actions: {
waitForElement: '要素が表示されるまで待ってやろう',
waitForClickable: 'クリック可能になるまで待ってやろう',
waitForVisible: '要素が見えるようになるまで待ってやろう',
waitForText: 'テキストが表示されるまで待ってやろう',
refresh: 'ページを更新してやろう',
amOnPage: 'URLにアクセスしてやろう',
click: 'クリックしてやろう',
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active October 1, 2024 23:45
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@clbarnes
clbarnes / install.sh
Last active October 29, 2022 12:21
Git hook installation script
#!/bin/bash
# Adapted from https://gist.github.com/tilap/0590e78c9cfd8f6548f5
# Basic script to set custom project hook and share it with other developers
#
# cd [path-of-the-script]
# . install.sh
#
# Folders usecase
@GhostofGoes
GhostofGoes / .gitignore
Created October 4, 2018 04:29
Basic .gitignore template for Python projects
# Editors
.vscode/
.idea/
# Vagrant
.vagrant/
# Mac/OSX
.DS_Store
@avinash-mishra
avinash-mishra / AWS-CLI.md
Last active September 10, 2018 08:02 — forked from stevenyap/AWS-CLI.md
AWS S3 Command Line

S3 Syncing

# sync from bucket to local
aws s3 sync <bucket> <target_folder> <options>
aws s3 sync s3://mybucket . --acl public-read

aws s3 sync --region ap-northeast-1 s3://[移動元バケット名] s3://[移動先バケット名]