SELF-INSTRUCT: Aligning Language Model with Self Generated Instructions
by Jerry Su, post on Apr 29, 2023Self-Instruct is a framework that helps language models improve their ability to follow natural language instructions. It does this by using the model’s own generations to create a large collection of instructional data. With Self-Instruct, it is possible to improve the instruction-following capabilities of language models without relying on …
Rust closure
by Jerry Su, post on Jan 05, 2023闭包:可以捕获其所在作用域中变量的匿名函数。
fn add_one_v1 (x: u32) -> u32 { x + 1 };
let add_one_v2 = |x: u32| -> u32 { x + 1 };
let add_one_v3 = |x| { x + 1 };
let add_one_v4 = |x| x + 1 ;
-
调用方式与函 …
Rust [] vs &[] vs vec![]
by Jerry Su, post on Jan 05, 2023What are the differences between [], &[], and vec![]?
Rust self vs &self vs &mut self
by Jerry Su, post on Jan 05, 2023-
self: (self: Self) Having a method that takes ownership of the instance by using just self as the first parameter is rare; this technique is usually used when the method transforms self into something else and you want to prevent the caller from using the original instance after the transformation …
Rust in JupyterLab
by Jerry Su, post on Dec 20, 20221.Install JupyterLab
2.Install Rust
-
curl https://sh.rustup.rs -sSf | sh
-
source $HOME/.cargo/env
-
export PATH="$HOME/.cargo/bin:$PATH"
3.Install Evcxr Jupyter Kernel
-
cargo install evcxr_jupyter
-
evcxr_jupyter --install
4.Reference
https://github.com/google/evcxr/blob/main/evcxr_jupyter/README.md
https://datacrayon.com/posts/programming …
Brackets Matching
by Jerry Su, post on Dec 16, 2022brackets = {')': '(', '》': '《', ')': '('}
brackets_open, brackets_close = brackets.values(), brackets.keys()
def brackets_match(text: str) -> int:
"""Brackets Match
"""
stack, error = [], []
for idx, char in enumerate(text):
if char in brackets_open:
stack.append((idx, char))
elif char in brackets_close:
if stack and stack[-1][-1] == brackets[char]:
stack.pop()
else:
error.append(idx)
if stack …
Paddle adversarial train
by Jerry Su, post on Nov 03, 2022Reason is the light and the light of life.
Multiprocessing in FastAPI
by Jerry Su, post on Jul 28, 2022Reason is the light and the light of life.
asyncio get_event_loop vs get_running_loop
by Jerry Su, post on Jul 28, 2022Reason is the light and the light of life.