In the context of the sample_top_p function you've provided, "cumulative probability mass" refers to the sum of probabilities for a sequence of tokens
bos=True: Ensures the BOS token is added, marking the start of each prompt.eos=False: Ensures the EOS token is not added, allowing the model to contin
text sequences를 만들어내는 함수.prompt를 입력으로 받아서 텍스트를 만들어냄.prompt_tokens (List\\\[List\\\[int\\]\\]): tokenized된 prompt의 리스트를 의미함. 각 프롬프트는 list of integer를 의
The list.extend() method in Python is used to extend a list by appending all the elements from another iterable (such as another list, tuple, string,
RMSNorm (Root Mean Square Normalization) is a normalization technique used in the architecture of large language models like LLaMA (Large Language Mod
[llama3/llama/generate.py def build](https://velog.io/@ma-kjh/llama3llamageneration.pyclass-Llama-def-build) 에서 Transformer
class llama에 대해 알아보자.해당 build 함수는 모델 체크포인트를 로딩하고 initializing해서 Llama instance를 빌드하는 과정.Args:가장 먼저 build가 정의되어 있다.ckpt_dir (str) : checkpoint file이 들어
Optional\[int] = None같은 코드는 뭘 의미하고 있을까..typing module의먼저 Optional의 사용은 몇가지 type hinting과 default value에 관련되어있다.Type Hinting : The Optional type is use
l: 주변 소스코드들을 출력, 현재 라인 표시.n: 다음 문장으로 이동.s: ‘Step Into’로 함수 내부로 들어감. 다 진행된 후에는 --Return--.c: 다음줄부터 중단점을 만날때까지 코드를 실행, 중단점이 없다면 끝까지 실행.r: 현재 함수의 return이
https://pytorch.org/docs/stable/generated/torch.optim.RMSprop.htmlRMSprop 수도코드는 아래와 같다.차근차근 위 내용을 설명해보자.일단 RMSprop이 왜나왔나부터 보면AdaGrad의 학습이 진행될 때 학
Reference : https://pytorch.org/torchtune/stable/tutorials/lora_finetune.htmlLoRA의 기본적인 아이디어는 pre-trained matrices (i.e. paprameters of the origi
torch.flatten(input, start_dim=0, end_dim=- 1) → Tensortorch.flatten 은 입력을 1차원 텐서로 reshape 해준다. start_dim과 end_dim을 입력해줄 수 있다.요런식으로 작동한다.start_dim을 설정
HF_HOMETo configure where huggingface_hub will locally store data. In particular, your token and the cache will be stored in this folder.Defaults to "
https://huggingface.co/docs/transformers/training
https://huggingface.co/learn/nlp-course/chapter1/1
https://www.sscardapane.it/assets/images/draw/hydra.png!\[](https://velog.velcdn.com/images/ma-kjh/post/4e930f60-17f7-4ee4-a623-6802206a2038