summer notes2

wy Lv3

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

Installation Commands

Install the necessary libraries for Hugging Face:

1
2
3
pip install transformers
pip install tokenizer
pip install datasets

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:

  • Hugging Face Documentation on Flash-Attention

  • CSDN Blog Post Installing Flash-Attention

  • 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](https://creativecommons.org/licenses/by-nc-sa/4.0).
          
      
    
    
          
      
    
      
    
      
    
      
          
              
                  
                      [Access to Internal Server From Jump Server
                              Prev posts](/2024/07/14/Access-to-Internal-Server-From-Jump-Server/)
                  
              
              
                  
                      [summer notes
                              Next posts](/2024/07/12/summer-notes/)
                  
              
          
      
    
      
          
              
    
    
      Comments
    
    
    
      
          
    
    
    
      
    
    
          
      
    
    
    
      
          
    
      On this page
      summer notes2
    
  1. Learning Notebook on Hugging Face and TOFU

  2. Hugging Face Hub Setup

  3. Python Virtual Environment Setup

  4. Installation Commands

  5. Model Size Information

  6. TOFU Environment Setup

       ©
       
         2022
         -
       
       2024    [wy](/)
       
           
           
    
               
                   24 posts in total
               
               
           
    
       
    
    
       
       
           
               
                   VISITOR COUNT
                   
               
           
           
               
                   TOTAL PAGE VIEWS
                   
               
           
       
    
    
       POWERED BY [Hexo](https://hexo.io)
       THEME [Redefine v2.6.4](https://github.com/EvanNotFound/hexo-theme-redefine)
    
    
    
       
           Blog up for  days  hrs  Min  Sec
    

-

-

-

-

-

-

-

  • Title: summer notes2
  • Author: wy
  • Created at : 2024-07-13 01:01:05
  • Updated at : 2024-07-13 04:36:57
  • Link: https://yue-ruby-w.site/2024/07/13/2024-07-13-summer-notes2/
  • License: This work is licensed under CC BY-NC-SA 4.0.