2024-08-02から1日間の記事一覧

【Diffusers】PixArtSigma で PAG (Perturbed-Attention Guidance) を使ってみる

Pythonスクリプト from diffusers import AutoPipelineForText2Image, PixArtSigmaPAGPipeline import torch pipeline = AutoPipelineForText2Image.from_pretrained( "PixArt-Sigma-XL-2-1024-MS", torch_dtype=torch.float16 ).to("cuda") prompt = "an in…

LangChainのPyPDFLoaderは非常に便利だけど、時に精度が良くないことも

はじめに PDFファイルを使ってRAGを行う時のPDFファイルの扱い方についてです。 以下の3つで比較しました。 pymupdfでテキストを抽出して手動でchunkに分割する方法 pymupdfでテキストを抽出して全文をファイルにいったん保存する方法 PyPDFLoaderを使う方法…