This file contains hidden or 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 os | |
| import torch | |
| import psutil | |
| import datasets | |
| import glob | |
| from transformers import ( | |
| AutoTokenizer, LlamaConfig, LlamaForCausalLM, Trainer, TrainingArguments, | |
| DataCollatorForLanguageModeling | |
| ) |
This file contains hidden or 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
| # hfget.py | |
| # Python 3.11.2 | |
| # Hugging Face Filesystem API: | |
| # https://huggingface.co/docs/huggingface_hub/en/guides/hf_file_system | |
| import os | |
| import sys | |
| import time | |
| from typing import Union |
This file contains hidden or 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 easy_llama as ez | |
| from subprocess import run | |
| USER = ez.utils.USER_STYLE | |
| BOT = ez.utils.BOT_STYLE | |
| DIM = ez.utils.DIM_STYLE | |
| RESET = ez.utils.RESET_ALL | |
| def say(something: str) -> None: | |
| run(['say', something]) | |
| Llama3 = ez.Model( | |
| 'Meta-Llama-3-8B-Instruct-q8_0.gguf', |
This file contains hidden or 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
| # safetensors_convert_fp16_to_8bit.py | |
| # Python 3.11.7 | |
| import safetensors.torch | |
| import safetensors | |
| import torch | |
| import os | |
| # blacklist takes priority over whitelist | |
| # a tensor will only be cast if it matches the whitelist but not the blacklist |
NewerOlder