summer notes2
Learning Notebook on Hugging Face and TOFU
This notebook is used to explore the functionalities of Hugging Face, a leading platform for natural language processing (NLP), and TOFU, a framework focused on unlearning in machine learning models.
Recommended Reading: Getting Started with Hugging Face
Hugging Face Hub Setup
- Install
huggingface_hub
and log in with a local token. - Important: Set up Git LFS for large files. See CSDN blog for details.
Python Virtual Environment Setup
- Python venv installation and setup: Python venv documentation , Hugging Face installation guide
Installation Commands
Install the necessary libraries for Hugging Face:
1 | pip install transformers |
Model Size Information
For details on determining the size of a Hugging Face pretrained model, refer to the following resources:
TOFU Environment Setup
Libraries Overview
accelerate: A library by Hugging Face to simplify running deep learning models on any hardware configuration, including multi-GPU setups.
deepspeed: Microsoft’s library that provides a suite of advanced optimizations to improve scalability and efficiency in training large models, especially on distributed systems.
evaluate: Developed by Hugging Face, it allows users to measure and compare the performance of models across a wide range of metrics and datasets easily.
hydra-core: A framework for elegantly configuring complex applications, allowing dynamic creation of configurations and simplifying the management of multiple experiments.
omegaconf: Complements Hydra by providing a hierarchical configuration system, which supports merging configurations from multiple sources and is type-safe.
peft: Possibly stands for Parallel Execution Framework for Transformers, which helps in optimizing the parallel execution of transformer models.
rouge_score: A package for evaluating text generation tasks by calculating ROUGE scores, which measure the quality of summaries or translated texts against reference texts.
einops: Provides more flexible and powerful operations for tensor manipulation and reshaping, making model code more readable and concise.
packaging: A utility library that assists in version comparisons and dependency management for Python packages.
bitsandbytes: An optimization library focused on improving training speed and reducing memory footprint through efficient CUDA operations.
ninja: A small build system with a focus on speed, enhancing the performance of backend processing during the compilation phase of software development.
Flash-Attention
Flash-attention
is a specialized technology designed to enhance the performance and efficiency of attention mechanisms in transformer models. It primarily focuses on reducing the computational complexity and memory usage, making it highly suitable for handling large-scale datasets or models.
For more detailed insights into flash-attention
and its applications, consider the following resources:
- Title: summer notes2
- Author: wy
- Created at : 2024-07-13 09:01:05
- Updated at : 2024-07-13 12:36:57
- Link: https://yuuee-www.github.io/blog/2024/07/13/summer-notes2/
- License: This work is licensed under CC BY-NC-SA 4.0.