Skip to content

Instantly share code, notes, and snippets.

View susumuota's full-sized avatar

S. Ota susumuota

View GitHub Profile
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active May 3, 2024 19:01
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
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--base_model_name_or_path", type=str)
@imksoo
imksoo / nostr_history.js
Last active March 16, 2023 05:40
Nostrのリレーから過去ログをあさってくるnode.js
const relay = 'wss://relay-jp.nostr.wirednet.jp'
const authors = ['634bd19e5c87db216555c814bf88e66ace175805291a6be90b15ac3b2247da9b']
function history (until = Math.floor(new Date() / 1000)) {
let socket
if (typeof (WebSocket) === 'undefined') {
const WebSocket = require('websocket').w3cwebsocket
socket = new WebSocket(relay)
} else {
socket = new WebSocket(relay)