Skip to content

Instantly share code, notes, and snippets.

View adibMosharrof's full-sized avatar

Adib Mosharrof adibMosharrof

  • University of Kentucky
  • Kentucky, USA
View GitHub Profile
@adibMosharrof
adibMosharrof / peft_example.py
Created May 16, 2023 15:40
PEFT training example code
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import transformers
from peft import (
LoraConfig,
PeftConfig,
PeftModel,
get_peft_model,
prepare_model_for_int8_training,
This file has been truncated, but you can view the full file.
"dialog_id","turn_id","context","target"
"1_00000","1","<|begincontext|><|beginlastuserutterance|>I am feeling hungry so I would like to find a place to eat.<|endlastuserutterance|><|endcontext|>","<|begintarget|><|begindsts|><|begindst|><|beginintent|>FindRestaurants<|endintent|><|beginbelief|><|endbelief|><|enddst|><|enddsts|><|beginuseraction|>INFORM_INTENT->Restaurants^intent~FindRestaurants<|enduseraction|><|beginaction|>REQUEST->Restaurants^city~<|endaction|><|beginresponse|>Do you have a specific which you want the eating place to be located at?<|endresponse|><|endtarget|>"
"1_00000","2","<|begincontext|><|user|>I am feeling hungry so I would like to find a place to eat.<|system|>Do you have a specific which you want the eating place to be located at?<|beginlastuserutterance|>I would like for it to be in San Jose.<|endlastuserutterance|><|endcontext|>","<|begintarget|><|begindsts|><|begindst|><|beginintent|>FindRestaurants<|endintent|><|beginbelief|>Restaurants^city->San Jose<|endbelief|><|enddst|><|en
@adibMosharrof
adibMosharrof / conda_env_export.txt
Created May 1, 2022 04:46
Conda Environment Export
conda env export --no-builds | grep -v ^prefix | grep -v ^name > environment.yml
@adibMosharrof
adibMosharrof / python
Created February 5, 2021 07:52
PySceneDetect extra frames error
from scenedetect.frame_timecode import FrameTimecode
from scenedetect import VideoManager, SceneManager, StatsManager
from scenedetect.detectors import ContentDetector
import cv2
threshold = 50
#please specify the video path
video_path = './tmp/test1.mp4'
#you can find the video at the url below
@adibMosharrof
adibMosharrof / gist:8149537
Last active January 1, 2016 13:09
ubuntu 12.04 .bash_aliases
alias s='sudo'
alias agu='sudo apt-get update'
alias agi='sudo apt-get install'
alias bright='xbacklight -set'
#aliases for laravel
alias art='php artisan'
#aliases for git
@adibMosharrof
adibMosharrof / fetch.php
Created April 4, 2013 21:31
PHP Laravel fetch.php task by jeffrey way
<?php
class Asset {
//Downloads the content of the file from internet
public function fetch( $assetPath ) {
return file_get_contents( $assetPath );
}
}
class Fetch_Task {