markdownlint-cli2

Node.js 18.16.0 markdownlint-cli2 0.6.0 https://www.npmjs.com/package/markdownlint-cli2 npm install -g markdownlint-cli2 # lint markdownlint-cli2 # format markdownlint-cli2-fix Config .markdownlint-cli2.yaml Example: https://github.com/DavidAnson/markdownlint/blob/fcb8190781c80b292ac44f6df984326e0e6c69cd/schema/.markdownlint.yaml # https://github.com/DavidAnson/markdownlint # https://github.com/DavidAnson/markdownlint-cli2 globs: - "**/*.md" ignores: - ".git/**" - ".github/**" config: # h1 MD025: false # inline HTML MD033: false

2023年4月17日 · aoirint

GatsbyのsiteMetadataにカスタムデータを追加する

Node.js 18.16.0 Gatsby 5.8.1 gatsby-config.ts const config: GatsbyConfig = { siteMetadata: { siteUrl: "https://example.com", title: "Example Blog", myCustomData: myCustomData, }, graphqlTypegen: true, // ... } gatsby-node.ts export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ({ actions }) => { const { createTypes } = actions createTypes(` type MyCustomData { text: String flag: Boolean } type SiteSiteMetadata { myCustomData: MyCustomData } `) } mypage.tsx import * as React from "react" import { graphql, PageProps, } from 'gatsby' import { GetMyPageQuery } from '../gatsby-types' const MyPage: React.FC<PageProps<GetMyPageQuery>> = (props) => { const data = props.data const site = data?.site const myCustomData = site?.siteMetadata?.myCustomData // ... } export const pageQuery = graphql` query GetMyPage { site { siteMetadata { myCustomData { text flag } } } } ` export default MyPage 参考 https://github.com/gatsbyjs/gatsby/issues/1781 https://stackoverflow.com/questions/61530280/unable-to-filter-custom-data-in-sitemetadata-in-gatsby-using-graphql-in-graphiql https://tomiko0404.hatenablog.com/entry/2022/02/20/gatasby-graphql-datalayer https://stackoverflow.com/questions/62984585/gatsby-how-to-handle-undefined-fields-in-sitemetadata

2023年4月17日 · aoirint

Jenkinsのapt GPGキーを更新する

$ sudo apt update Err:9 https://pkg.jenkins.io/debian-stable binary/ Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5BA31D57EF5975CA W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5BA31D57EF5975CA W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5BA31D57EF5975CA W: Some index files failed to download. They have been ignored, or old ones used instead. ...

2023年4月17日 · aoirint

Gitの改行コード自動置換機能(autocrlf)を無効化する

https://stackoverflow.com/questions/21822650/disable-git-eol-conversions git config --global core.autocrlf false git add --renormalize . すでにautocrlfが適用されたファイルを元に戻すために、既存のローカルリポジトリではadd --renormalizeが必要です。 GitのCRLF自動置換機能のためにDocker Buildに失敗する例 改行コードCRLFで以下のようなDockerfileを作成すると、 # syntax=docker/dockerfile:1.4 FROM ubuntu:22.04 RUN <<EOF set -eux echo "OK" EOF 以下のようなエラーとなり、ビルドに失敗します。 ------ > [2/2] RUN <<EOF (set -eux...): #8 0.294 /bin/sh: 1: set: Illegal option - ------ executor failed running [/bin/sh -c set -eux echo "OK" ]: exit code: 2 GitのCRLF自動置換機能によって、Dockerfileの改行コードがCRLFに書き換えられることでも同じことが起きます。 Linuxの仮想化ソフトウェアであるDockerの構成ファイルにCRLFが使われることが想定されないのは理解できます。 WindowsでDockerを扱っていることは理解してください。 .gitattributesでリポジトリごとに改行コードのポリシーを変更することができますが、令和の時代に改行コードの切り替えができないテキストエディタを使うこともないと思われるので、 不要なCRLF自動置換機能を無効化する方が、たくさんのリポジトリを扱う人には向いているでしょう。

2023年4月16日 · aoirint

pyenvでPyInstallerを使えるようにする

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11.3 https://pyinstaller.org/en/stable/development/venv.html

2023年4月16日 · aoirint

Waifu Diffusion 1.4 Epoch 2 + 東北ずん子PJ公式イラスト LoRA作成テスト

種類 LoRA ベースモデル Waifu Diffusion 1.4 Epoch 2 生成例 生成例1 <lora:tohoku_zunko-20230404.1-epoch-000010:1:OUTD>, (tohoku zunko girl:1), 1girl, solo, hairband, long hair, green hairband, japanese clothes, yellow eyes, smile, green hair, open mouth, upper body, white background, kimono, simple background, ahoge, very long hair, short kimono, looking at viewer, masterpiece, best quality, ultra-detailed Negative prompt: lowres, ((bad anatomy)), ((bad hands)), text, missing finger, extra digits, fewer digits, blurry, ((mutated hands and fingers)), (poorly drawn face), ((mutation)), ((deformed face)), (ugly), ((bad proportions)), ((extra limbs)), extra face, (double head), (extra head), ((extra feet)), monster, logo, cropped, worst quality, jpeg, humpbacked, long body, long neck, ((jpeg artifacts)), deleted, old, oldest, ((censored)), ((bad aesthetic)), (mosaic censoring, bar censor, blur censor) Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 4052543271, Size: 512x512, Model hash: 1f108d4ceb, Model: wd-1-4-anime_e2 生成例2 ...

2023年4月15日 · aoirint

Stable Diffusion に関するメモ

Stable Diffusionは、ミュンヘン大学のCompVis研究グループ、スタートアップ企業のStability AI、Runwayの三者が共同で2022年8月にリリースした、オープンソースの画像生成AIモデル。 「プロンプト」という単語列に従って画像を生成する、Text to Imageモデルの一種。 CompVis/stable-diffusion: A latent text-to-image diffusion model Creative ML OpenRAIL-Mという独自のオープンソースライセンスのもと配布され、 望ましくない使い方を禁止するいくつかの制限のもと、再利用が認められている。 CreativeML OpenRAIL-Mライセンス原文 - CompVis/stable-diffusion - GitHub 同時期に公開された類似の画像生成AIには、DALL·E2やMidjourneyがある。 公式の有償サービスとして、DreamStudioが提供されている。 Stable Diffusionは、学習済みモデルを含めてオープンソースであるため、ユーザのローカル環境や、Googleが提供するGPU環境であるColaboratory上、オープンソースコミュニティHugging Face上での推論実行が可能なほか、Fine tuningなどにより変更を加えたモデルを公開することができる。 Stable Diffusion派生モデルには、アニメ風の絵・萌え絵に特化したWaifu Diffusionや、NovelAIの画像生成サービスなどがある。

2023年4月15日 · aoirint

NovelAI リークモデルに関する調査メモ

NovelAIは、2022年10月に独自のStable Diffusion派生モデルによる画像生成サービスをリリースした。 Image Generation has arrived, NovelAI Diffusion is here! | Medium しかし、このサービスに使われているとみられる生成モデルが流出してしまった。 animefull-final-pruned: sha256 925997e9 animesfw-final-pruned: sha256 1d4a34af animevae.pt: sha256 f921fb3f 現在では、Stable Diffusion派生の異なるモデルを合成する、モデルマージと呼ばれる手法など、 様々な手法により生まれた「NovelAIリーク派生モデル」とみられるモデルが流通してしまっている。 NovelAIリーク派生モデルとみられるモデルの例 Anything V3/V5 Anything V4 OrangeMixs 関連リンク Welcome to sdupdates Discussions! · questianon/sdupdates · Discussion #1 · GitHub New (suspected) NAI model leak - AnythingV3.0 and VAE for it · AUTOMATIC1111/stable-diffusion-webui · Discussion #4516 · GitHub Emulate NovelAI · AUTOMATIC1111/stable-diffusion-webui · Discussion #2017 Anything v4.5 VAE swapped · AUTOMATIC1111/stable-diffusion-webui · Discussion #7044 AIの著作権問題が複雑化 - 週刊アスキー 高杉 光一🦋 @14:59さんはTwitterを使っています: 「画像生成AI界隈でよく使われるモデルの系列調査 いわゆる"アスカチャレンジ"です 元々はNovelAIとリークNAIの関係調査に使われたものです それを手持ちのすべてのSD1.4系メジャーモデルに当てはめたのがこちらとなります 画質はご容赦を #AIart #waifudiffusion #anythingv3 #ACertainThing https://t.co/6aP8g0q4pz」 / Twitter

2023年4月15日 · aoirint

Stable Diffusion + LoRA に関するメモ

LoRA(Low-Rank Adaptation)は、2021年にEdward Huらが提案した、大規模言語モデルを効率的にFine tuningする手法。 https://github.com/microsoft/LoRA https://arxiv.org/abs/2106.09685 An important paradigm of natural language processing consists of large-scale pretraining on general domain data and adaptation to particular tasks or domains. As we pre-train larger models, full fine-tuning, which retrains all model parameters, becomes less feasible. Using GPT-3 175B as an example – deploying independent instances of fine-tuned models, each with 175B parameters, is prohibitively expensive. We propose Low-Rank Adaptation, or LoRA, which freezes the pretrained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture, greatly reducing the number of trainable parameters for downstream tasks. Compared to GPT-3 175B fine-tuned with Adam, LoRA can reduce the number of trainable parameters by 10,000 times and the GPU memory requirement by 3 times. LoRA performs on-par or better than finetuning in model quality on RoBERTa, DeBERTa, GPT-2, and GPT-3, despite having fewer trainable parameters, a higher training throughput, and, unlike adapters, no additional inference latency. We also provide an empirical investigation into rank-deficiency in language model adaptation, which sheds light on the efficacy of LoRA. We release a package that facilitates the integration of LoRA with PyTorch models and provide our implementations and model checkpoints for RoBERTa, DeBERTa, and GPT-2 at https://github.com/microsoft/LoRA. ...

2023年4月15日 · aoirint

回転ずし

くら寿司に行ってみた 少なくとも数年単位で久しぶりと思われる あらかじめ調べたところ、予算2000円で17皿食べられるらしいので、 気軽に行くにはちょっとお高いけれど、まあお試しということで 受付のタッチパネルで人数を選択、席番号と会計用のバーコードが印刷されたレシートが出力された 1人なのでカウンター席 初見はちょっと狭いかなと思ったけれど、席に皿回収口があって、 食べ終わった皿がかさばらないので問題なかった 席上部のタブレットから注文ができる レーンから自由に取るのもいいけれど、今回はあらかじめメニューを決めていたので、 その通りに5皿ずつ注文することにした 在庫の都合か注文できない(表示されていない)ものもあったので、それは代わりの別のものを注文した ときどき画面が更新中、と切り替わり、おそらく注文可能なメニューのデータ更新をしているらしい。この間は操作できないが、すぐ終わる レーンにおそらくランダムと思われる115円皿が回っていた。前述の通りメニューを決めていたので取らなかった タブレットに最初に触るとき、ビッくらポンするかどうか選択 存在は知りつつ、何の特典があるのかよく知らなかったけれど、せっかくなのでYes 5皿回収ごとにタブレットの画面で抽選演出が流れ、当選すると席上部のガシャポン的な機械からガシャが排出される 10皿目の回収で当選した。名探偵コナンコラボらしく、新作映画の黒鉄の魚影イメージと思われる黒の組織のデコテープだった 食事に遊び心を、という回転ずしのコンセプトとマッチした、いいサービスだなと思った 注文すると数分で上部レーン(下段は通常のレーン、上段は注文専用のレーン)に皿が届く 1回、配送の勢いでサーモンがシャリからぽろっと落ちたのは面白かった。本当は提供基準的にダメなのかもしれないけれど、 高級サービス店ではないし、それも遊び心の内ということでいいでしょう 皿を回収口に投入すると、タブレットに回収済みの皿の枚数が表示される 会計はタブレットで会計を選択 スタッフがやってきて、会計内容の確認(タブレットに表示された皿の枚数)と会計の案内をされる 会計はセルフレジ、バーコードを読ませて決済方法を選択 空いている時間を狙って、変な時間に食べに行ったので、対人の会計がちょっと億劫だったのだけれど、 自動化されていて、システマティックでよかった 注文はタブレットでも、会計は対人だったりするので 会計前の確認は人が必要なので仕方ない 17皿食べて満足した 余力でいえばまだ食べられるけれど、予算に達したのでこれにて終了 ハンバーグとか焼肉とか、魚ではないネタも結構注文した。これも回転ずしならではと思うので、楽しめた 予算の都合でデザートは頼まなかったけれど、まあいいでしょう

2023年4月11日 · aoirint