Skip to content

Instantly share code, notes, and snippets.

View ayutaz's full-sized avatar

yousan ayutaz

View GitHub Profile
@alfredplpl
alfredplpl / gemma_finetune_lora.py
Created February 24, 2024 04:23
Gemma初心者ファインチューニングコードです。HFの設定などはよしなにやってください。
# Reference #1: https://note.com/npaka/n/nc55e44e407ff
# Reference #2: https://huggingface.co/blog/gemma-peft
# Licence: MIT
from peft import LoraConfig
lora_config = LoraConfig(
r=8,
target_modules=["q_proj", "o_proj", "k_proj", "v_proj", "gate_proj", "up_proj", "down_proj"],
task_type="CAUSAL_LM",
@halby24
halby24 / LookAtIKInEditMode.cs
Created July 6, 2019 03:28
Unityのエディタ上で視線IKが動かせるスクリプトだよ
using UnityEngine;
[ExecuteInEditMode]
public class LookAtIKInEditMode : MonoBehaviour
{
[SerializeField] private bool active;
[SerializeField] private Transform target;
[SerializeField, Range(0f, 1f)] private float lookAt;
[SerializeField, Range(0f, 1f)] private float body;
[SerializeField, Range(0f, 1f)] private float head;
@neon-izm
neon-izm / AnchorPreset.cs
Created May 21, 2017 13:18
RectTransformのAnchorのプリセットをスクリプトから「インスペクタ上のenumと同じように」 指定する為の拡張クラス
using UnityEngine;
/// <summary>
/// RectTransformのAnchorのプリセットをスクリプトから「インスペクタ上のenumと同じように」
/// 指定する為の拡張クラス
/// プロジェクト内の適当な場所に保存しておくと、以下のようにRectTransformに対してSetAnchor()メソッドが使えるようになる
/// </summary>
/* usage
var rect = GetComponent<RectTransform>();
'use strict';
function getInstance(consumer_key, consumer_secret) {
return new TwitterWebService_(consumer_key, consumer_secret);
}
var TwitterWebService_ = function (consumer_key, consumer_secret) {
this.consumer_key = consumer_key;
this.consumer_secret = consumer_secret;
}