• Override mathjax in mdbook

    If your mdbook is using mathjax v2.x (which is the case when downloading mac binary), you can override its font and expression to trigger mathjax. In book.toml, add the followings And in mathjax-config.js (which should be at the top of your project directory and not under src): Change ‘scale’ to adjust font size. Also, see…

    Tags:

  • Better prompt formatting for LLM uses

    One of the typical way to format prompt is using { … } like the below: But it fails as soon as JSON is involved in the input or output. Then, what should we do? My proposal is using string.Template. Its primary purpose is i18n, but it also provides a much more safe formatting, e.g.,…

    Tags:

  • Map reduce pattern in LLM

    One of the primary patterns of using LLM is map reduce. For example, process multiple docs in mappers and then reduce them as a single result in the reducer. LLM mapreduce sounds very intuitive and simple, but in reality it isn’t. One of the problem is hallucinations. When hallucinate, LLM fails unexpectedly in an obvious…

    Tags:

  • Using a static external IP for google cloud run

    Using static ip for google cloud run when connecting to external network is pretty useful if any of your external counterpart is using ip address based authentication, e.g., mongodb. There’s VPC peering to solve this problem, but it takes a good amount of money for small experiments. This document explains how one can use static…

    Tags:

  • responsive web using rem

    Using rem (default 16px), one can write web page containing html elements and texts in harmony. Default root element font size is 16px, but many users override it for better readability. Use of rem respects that. https://www.sitepoint.com/understanding-and-using-rem-units-in-css/ Setting default font size and browser zoom level are two different controls. Browser zoom scales up everything by…

    Tags:

  • Polyak averaging and gradient accumulation in the Keras

    So I discovered them in the tweets. As the paper Polyak Parameter Ensemble: Exponential Parameter Growth Leads to Better Generalization shows, Polyak Ensemble is for better generalization. Another in the tweet is gradient accumulation. I don’t know if I’ll need it since I often makes the batch size as large as possible.

  • 저성과자와 일하는 고민

    성과가 아주 좋은 개발자는 그렇지 못한 개발자에 비해 100배 더 뛰어날까? 나는 그런 개발자가 팀을 이끌고 조직을 이끌면 그럴 수 있다고 본다. 그러나 1대 1로 붙었을 때 평균적인 개발자보다 100배가 뛰어나는 것은 불가능하다고 본다. 예를들어 워드 프레스 테마를 초기화하는 문제에대해 뛰어난 개발자는 누구보다 훨씬 빠르게 코드에서 답을 찾아 낼 수는 있겠지만 어떻게 초기화하는게 정석인지 까지…

    Tags:

  • How to erase customization in a wordpress template

    It was so painful to find out this. Deleting and reinstalling templates don’t reset the templates to the original one. I tried plugins like wp reset to reset theme, and tried database cleaner to find database table containing the customziation. I connected to the database in a command line and checked all the tables, but…

    Tags:

  • How to debug user warning in pydantic

    When pydantic comes across serialization issues, it outputs: But that doesn’t leave much trace to debug. To fix that, change warning filter. Then now you’ll see stack trace was the warning becomes an exception.

    Tags:

  • How to wait for ProcessPoolExecutor and ThreadPoolExecutor

    If your wait() doesn’t work, it’s probably due to exception that wasn’t caught. Catch it.

    Tags: