Skip to content

Instantly share code, notes, and snippets.

View enze5088's full-sized avatar

Enze enze5088

View GitHub Profile
@taowen
taowen / generate_typed_dict.js
Last active November 28, 2024 05:31
根据 json 生成 python 的 typed dict。验证 haiku 对 few shot 的指令遵从性
const YOUR_CLAUDE_KEY = ''
async function main() {
const resp = await fetch('https://api.anthropic.com/v1/messages', {
method: 'POST',
headers: {
"x-api-key": YOUR_CLAUDE_KEY,
"anthropic-version": '2023-06-01',
"content-type": "application/json",
},
body: JSON.stringify({
@K024
K024 / trim.py
Last active April 29, 2023 09:29
# trim.py
# trim the vocabulary of mt5 model in huggingface.co
# MIT License
# Copyright (c) 2022 K024
# %%
import torch
from tqdm.auto import tqdm
# %%
@zxhfighter
zxhfighter / fork-and-push.md
Last active November 5, 2025 06:54
如何给开源项目贡献代码

如何给开源项目贡献代码

分两种情况:

  • 代码仓库管理者给你添加该仓库的写入权限,这样的话可以直接push
  • 如果不能直接push(大多数情况),采用经典的fork & pull request来提交代码,下面讲述这种情况

fork & pull request

例如有个仓库https://github.com/ecomfe/esui.git,其采用了经典的分支开发模型,稳定后的代码提交到master分支,其余特性则在dev分支上进行开发,待成熟后合并回master分支。