Skip to content

Instantly share code, notes, and snippets.

View googlefan256's full-sized avatar
💭
Its Me! Googlefan.

googlefan256

💭
Its Me! Googlefan.
View GitHub Profile
@googlefan256
googlefan256 / gas.js
Created September 3, 2022 13:53
Gasでgoogle translateを自動言語検知ありで使えるやつです
function translate(text, from = "auto", to) {
try {
const result = UrlFetchApp.fetch(
"https://translate.google.com/_/TranslateWebserverUi/data/batchexecute",
{
payload:
"f.req=" +
encodeURIComponent(
JSON.stringify([
[
@googlefan256
googlefan256 / Makefile
Created October 22, 2023 08:48
tiny-python
FROM gcr.io/distroless/python3 AS distroless
FROM scratch
COPY --from=distroless /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libpthread.so.0
COPY --from=distroless /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so.2
COPY --from=distroless /lib/x86_64-linux-gnu/libutil.so.1 /lib/x86_64-linux-gnu/libutil.so.1
COPY --from=distroless /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libm.so.6
COPY --from=distroless /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1
COPY --from=distroless /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=distroless /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=distroless /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
プロンプト:
あなたは料理番組の司会者です。今日のテーマは「誰もが驚く簡単で豪華なディナー」。限られた食材で簡単に作れる豪華な料理を紹介し、視聴者に「こんな簡単で美味しい料理があるなんて!」と思わせる説明をしましょう。 料理の過程で、時折視聴者にクイズを出したり、簡単な料理のコツを教えたりするなどして、視聴者の参加意識を高め、一緒に料理を楽しめるような雰囲気を盛り上げてください。 具体的にどんな料理を紹介するか、クイズの内容、料理のコツなど、詳しく教えてください。
ベースモデル:
料理:おろし野菜と魚粉のタネ
* 簡単に作れ、栄養満点な料理です。
* 時間制限は短く、家族や友人と簡単に一緒に作ることができます。
クイズ:
package commandparser
import (
"encoding/json"
"errors"
"fmt"
"regexp"
"strings"
)
@googlefan256
googlefan256 / main.py
Created May 23, 2025 04:57
Qwen3 0.6B with tinygrad.
from tinygrad import Tensor, nn, dtypes, TinyJit, Variable, Context
from tinygrad.dtype import DType
from transformers import AutoTokenizer
from typing import Tuple, Optional, List, Dict, Generator
from huggingface_hub import hf_hub_download
import time
from tqdm import tqdm
Tensor.no_grad = True
def ai(prompt: str):
from google import genai
client = genai.Client(api_key="")
response = client.models.generate_content(
model="gemini-2.5-flash-lite-preview-06-17",
contents=f"Write a python3 code only, no explanation. {prompt}"
)
code = response.text
if code.startswith("```python"):
code = code.removeprefix("```python").strip()
@googlefan256
googlefan256 / main.rs
Created June 26, 2025 15:12
tinygrad in rust working example
use std::ffi::c_int;
fn inner() -> anyhow::Result<()> {
use tinygrad_in_rust::backend::cuda;
cuda::cuda_init("/usr/lib/x86_64-linux-gnu/libcuda.so")?;
cuda::nvrtc_init("/usr/local/cuda/lib64/libnvrtc.so")?;
cuda::nvjitlink_init("/usr/local/cuda/lib64/libnvJitLink.so")?;
let res = cuda::CuCompiler::new_default()?.compile(
r#"
extern "C" __global__ void add(int *a, int *b, int *c, int size) {
@googlefan256
googlefan256 / main.py
Created July 2, 2025 02:45
DiffCoder 7Bと会話
from transformers import AutoModel, AutoTokenizer
import torch
torch.backends.cudnn.benchmark = True
device = "cuda:0"
tokenizer = AutoTokenizer.from_pretrained(
"apple/DiffuCoder-7B-cpGRPO", trust_remote_code=True, device_map=device
)
model = AutoModel.from_pretrained(
@googlefan256
googlefan256 / run.py
Created July 10, 2025 14:34
Mem-Agent
#!/usr/bin/env uv run --with openai,transformers,tqdm--script
from openai import AsyncOpenAI
from transformers import AutoTokenizer
from tqdm import tqdm
import argparse
parser = argparse.ArgumentParser(description="RL Memory Agent")
parser.add_argument(
"--api_base",
type=str,

Keybase proof

I hereby claim:

  • I am googlefan256 on github.
  • I am googlefan (https://keybase.io/googlefan) on keybase.
  • I have a public key whose fingerprint is AC17 E177 D62B 0257 D178 CE82 F2AA 7332 18A6 1B47

To claim this, I am signing this object: