This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| # License: CC0 | |
| """ | |
| rinna/japanese-gpt-neox-3.6b-instruction-ppo と gradio を使ったチャット UI のサンプル実装です。 | |
| -> https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-ppo | |
| transformers.TextIteratorStreamer API を利用して、 ChatGPT のように生成したテキストを少しずつ表示し、ユーザー体験を向上させています。 | |
| -> https://huggingface.co/docs/transformers/v4.29.1/en/internal/generation_utils#transformers.TextIteratorStreamer | |
| streamer クラスの API は開発中のため、近い将来互換性がなくなる可能性があります。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run the Chrome Devtools Protocol via puppeteer-core to automatically save the contents of network communications to a local file. | |
| const puppeteer = require('puppeteer-core'); | |
| const fs = require('fs/promises'); | |
| const path = require('path'); | |
| const [nodePath, scriptPath, ...args] = process.argv; | |
| const how2useMsg = " node intercept-requests.js outputDir [urlPattern] [matchRegExp]\n outputDir: Output Directory\n urlPattern: If specified, only URLs matched with wildcards will be fetched. see https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#type-RequestPattern . It's better to specify this for performance reasons.\n matchRegExp: If specified, only URLs that match regular expressions will be saved."; | |
| if (args.length < 1) { | |
| console.log(`one or more arguments are required.\n\n${how2useMsg}`); | |
| process.exit(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // タイトルをコピーするモーダルダイアログを表示させる | |
| (() => { | |
| // フレームを使っている場合は、先頭のフレームのドキュメントを対象とする | |
| let d = "FRAMESET" === top.document.body.tagName ? top.frames[0].document : document, g = k => d.getElementById(k), c = d.createElement("div"), i = "modalBMId_key"; | |
| // モーダルダイアログを表示させるエレメントの作成 | |
| c.innerHTML = `<div id=${i}m style="position:fixed;width:100%;height:100%;top:0;left:0;text-align:center;background:rgba(0,0,0,.5);padding:16px 20px;z-index:2147483640"><div style="display:inline-block;background:#fff"><div style="padding:8px"><div id=${i}b></div><div><label for=${i}i style="color:#000">copied:</label><input id=${i}i style="width:400px" readonly/></div></div></div></div>`; | |
| let m = g(i + "m"); | |
| if (!m) { | |
| d.body.prepend(c.firstChild); | |
| // 変換テンプレートの宣言 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ubuntu Server for Raspberry Pi の cloud-init 初期化スクリプトの書き換え例です |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generated by Cargo | |
| # will have compiled files and executables | |
| debug/ | |
| target/ | |
| # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | |
| # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | |
| Cargo.lock | |
| # These are backup files generated by rustfmt |
OlderNewer