๐จ๐ซ24 [LangChain] OSError: /usr/lib/x86_64-linux-gnu/libc.so.6: version not found (required by ~) ์๋ฌ ๋ฉ์์ง ์๋ณธ์ OSError: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/conda/lib/python3.10/site-packages/gpt4all/llmodel_DO_NOT_MODIFY/build/libllmodel.so) LangChain ๊ณต์ ๋ฌธ์๋ฅผ ๋ณด๋ฉด์ ์ค์ต์ ํ๋ ์ค ์๋ ์ฝ๋๋ฅผ ์คํํ๋๊น ๋ฌ ์๋ฌ ๋ฉ์์ง์ด๋ค. ์ฑ์งํผํฐ+๊ตฌ๊ธ๋ง์ผ๋ก ์ด๊ฒ์ ๊ฒ ์ฐพ์๋ณด๊ณ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ ์๋ํด๋ดค๋ค. 1) Ubuntu ๋ฒ์ ์ ๋ฐ์ดํธ Ubuntu 20.04๋ฉด 22.04๋ก ๋ฐ๊ฟ๋ณด๋ผ๋ ๊ธ์ด ์ข ์ข ์์์ง๋ง ์ด๋ฏธ 22.04๋ฅผ ์ฌ์ฉํ๊ณ ์์ด์ ์ด ๋ฐฉ๋ฒ์ ์๋ฏธ๊ฐ ์์๋ค. 2) GPT4All ๋ฒ์ ๋ฎ์ถ๊ธฐ → ์ด ๋ฐฉ๋ฒ.. 2024. 1. 25. [LangChain] LangChain+Streamlit+FastAPI ๋ด๊ฐ ํท๊ฐ๋ ค์ ์คํ ์์๋ฅผ ์ ๋ฆฌํด๋๋ค. 1. app.py - streamlit์ด ๊ตฌํ๋์ด ์๋ py ํ์ผ 2. api.py - LangChain, FastAPI๊ฐ ๊ตฌํ๋์ด ์๋ py ํ์ผ 1. app.py ์คํ 2. api.py ์คํ 3. app.py๋ฅผ ์คํํ์ ๋ ๋์ค๋ URL๋ก ์ ์ 2024. 1. 8. [Hugging Face] Trainer.train() ์ฌ์ฉ ์ ํ์ต ์ด์ด์ ํ๊ธฐ trainer.train(resume_from_checkpoint=True) ๋จ ์ ์ฝ๋์ ํ ๊ฐ์ง ๋ฌธ์ ์ ์ ์ฒ์ ์ ์ฝ๋๋ฅผ ์คํํ๋ฉด ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฌ๋ค๋ ๊ฑฐ๋ค. ์ผ๋จ try-except๋ฌธ์ผ๋ก ์ฝ๋๋ฅผ ์์ ํด๋๋๋ฐ ์์ ํด๊ฒฐ์ฑ ์ธ ๊ฒ ๊ฐ๊ธฐ๋ ํด์ ์ด์ง ์ฐ์ฐํ๊ธด ํ๋ค. ValueError: No valid checkpoint found in output directory (TrainingArguments์ ์ง์ ํ output ๋๋ ํ ๋ฆฌ๋ช ) 2023. 12. 15. [Hugging Face] transformers ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฒ์ ํ์ธ & ๋ฒ์ ์ ๊ทธ๋ ์ด๋ ๋ฒ์ ํ์ธ import transformers print(transformers.__version__) ๋ฒ์ ์ ๊ทธ๋ ์ด๋ pip install --upgrade transformers 2023. 12. 14. [Hugging Face] ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. Perhaps your features (`labels` in this case) have excessive n.. ์ด์ค๋ฒ๋๊ป์ ์ฌ๋ ค์ฃผ์ QLoRA+Polyglot-Ko-12.8B ํ์ต ์์ ๋ฅผ ๋ณด๊ณ ๋ฐ๋ผํ๊ณ ์์๋๋ฐ ์๋ณธ ์ฝ๋์์๋ ๋์ค์ง ์๋ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค. ๊ตฌ๊ธ๋งํด์ ์ฐพ์๋ ํด๊ฒฐ๋ฒ(tokenizer ์ธ์๋ก padding=True/๋๋ 'max_length', truncation=True/๋๋ 'max_length' ์ถ๊ฐ)์ด ํ๋๋ ๋จน์ง ์์์ ๋๋ฌด ๋ต๋ตํ์๋๋ฐ ์๋์ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐํ ์ ์์๋ค. ํต์ฌ์ remove_columns! โ ํด๊ฒฐ ๋ฐฉ๋ฒ dataset = dataset.map(lambda samples: tokenizer(samples["text"], padding=True, truncation=True, max_length=128), batched=True, remove_columns=['input.. 2023. 8. 24. [PyTorch] RuntimeError - dtype, grad_fn RuntimeError: Expected floating point type for target with class probabilities, got Long ํ์ต ๊ณผ์ ์์ loss = loss_fn(pred, label) ์ฝ๋๋ฅผ ์ฌ์ฉํ๋๋ฐ, pred์ label์ด float์ผ ์ค ์์๋๋ฐ long์ ๋ฐ์๋ค๋ ์๋ฌ ๋ฌธ๊ตฌ๋ค. ์์ ์๋ loss ๊ตฌํ๋ ๋ถ๋ถ์์ ๋ฐ์ดํฐ ํ์ ์ ์ง์ ํด์ค ์ ์ด ์๋ ๊ฒ ๊ฐ์๋ฐ ์๋ง ๋ฐ์ดํฐ์ ํด๋์ค๋ collate_fn ํจ์์์ ์ค์ ํด์คฌ๋ ๋ฏ? ์ด๋ฒ์๋ ์ ๋ถ๋ถ์์ ๋ฐ์ดํฐ ํ์ ์ ๋ช ์ํด์คฌ๋ค. โ ํด๊ฒฐ ๋ฐฉ๋ฒ loss = loss_fn(torch.tensor(pred, dtype=torch.float16), torch.tensor(label, dtype=torch.float16)) R.. 2023. 6. 27. ์ด์ 1 2 3 4 ๋ค์