This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pynvml, time | |
from pynvml import * | |
TEMP_MIN_VALUE = 30.0 # fan is around 30% | |
TEMP_MAX_VALUE = 65.0 # fan is at 100% onwards | |
TEMP_RANGE = TEMP_MAX_VALUE - TEMP_MIN_VALUE | |
def fanspeed_from_t(t): | |
if t <= TEMP_MIN_VALUE: return 0.0 | |
if t >= TEMP_MAX_VALUE: return 1.0 | |
return (t - TEMP_MIN_VALUE) / TEMP_RANGE |