RSSAmplifier

Blog

Akshit Kumar's index.html

akshit.oneRSS feed ↗17 posts

Latest posts

William: a tiny poetry model in the browser

William is a tiny local language model I trained to write short poems. The model on this page is loaded by the browser and sampled locally, one token at a time. There is no server endpoint behind the button. loading William... write The title line is editable. William tokenizes it in the browser before generating the poem. William is a small decoder-only transformer: 6 layers, 384 hidden…

Interactive Shell Inside a Slurm Job

To access the shell inside a job, instead of SSHing into the node (in a case when one has multiple jobs in the same node). srun --jobid = <jobid> --pty bash

Configuring Pyright with uv

To get pyright to look at the correct package installation folder (using pyproject.toml, like uv does), add the following to the pyproject.toml. [tool.pyright] venv = ".venv" venvPath = "."

Custom uv Environments and Caches with direnv

When working on turing/ada, it is useful to install python packages on the /scratch directory instead of .venv . Fortunately, the blessed people at uv have a specific command for this. # .envrc export UV_PROJECT_ENVIRONMENT = /scratch/venvs/myproj export UV_CACHE_DIR = /scratch/uv_cache Add it to direnv and then run direnv allow to approve. Test using: uv add tqdm pip # only to be able to >pip…

Establishing Communication

Michelangelo, The Creation of Adam (c. 1512) From Ilya Sutskever, Oriol Vinyals & Quoc V. Le , “Sequence to Sequence Learning with Neural Networks,” Advances in Neural Information Processing Systems 27 (2014). arXiv:1409.3215 Section 3.3 - Reversing the Source Sentences While the LSTM is capable of solving problems with long term dependencies, we discovered that the LSTM learns much better when…

--index-strategy unsafe-best-match

Installing PyTorch 2.5.1, Fairseq2, CUDA 12.1. uv pip install fairseq2 --pre --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/pt2.5.1/cu121 --upgrade --index-strategy unsafe-best-match Note from uv: “A compatible version may be available on a subsequent index (e.g., https://pypi.org/simple). By default, uv will only consider versions that are published on the first index that contains a…

biaffine dependency parsing

\[h_{i}^{head} = FNN^{head}(r_i)\] \[h_{i}^{dep} = FNN^{dep}(r_i)\] \[s_{i,j} = Biaff(h_i^{head}, h_j^{dep})\] \[Biaff(x_1, x_2) = x_1^T U x_2 + W(x_1 \oplus x_2) + b\] \[ArcScore :: Biaff(x_1, x_2) \rightarrow p^{|toks|}\] \[LabelScore :: Biaff(x1, x2), pred \rightarrow p^{|labels|}\] References Applying Occam’s Razor to Transformer-Based Dependency Parsing: What Works, What Doesn’t, and What is…

Fixing the Python REPL in Emacs

The default uv python install uses libedit readline which doesn’t work well with emacs. Fix pip install gnureadline python3 -m override_readline might have to remove __file__ from override_readline.py , this has been solved already here but not merged yet. this should make the repl use gnureadline. final check import readline print ( readline . __doc__ ) should print 'Importing this module enables…

std::multiset

For problems needing logarithmic searching and removing, like concert tickets , std::multiset multiset < int > tickets ; for { auto it = tickets . upper_bound ( x ) if () { .. } else { tickets . erase ( x ) } }

Ada Cluster Reference

ncdu for looking at the disk usage. sinteractive -c 10 -g 2 for getting a node. Jupyter setup Run jupyter lab password followed by jupyter lab --no-browser on ada. Tunnel to your system: ssh -L 1025:localhost:8888 -J akshit.kumar@ada.iiit.ac.in akshit.kumar@gnodeXX connect to localhost:1025 using emacs/browser. pyenv and pipenv torch install pipenv install torch torchaudio torchvision set local…

Static Types and Legacy Python

Update: pls use pathlib I was given a folder of python2 files to work with for a task required to be done for my lab (LTRC, IIIT-H). The files, of course, had issues – they were written some time ago by people no longer associated with the project. The issues weren’t really unsolvable in any way. Most of them involved file_not_found – probably due to a path issue or some variable lacking a…

Fetching Recent Last.fm Tracks

#!/usr/bin/env python3 import http.client import json api_key = "thistotallyworks" username = "marxplank" conn = http . client . HTTPSConnection ( "ws.audioscrobbler.com" ) url = f "/2.0/?method=user.getrecenttracks&user= { username } &api_key= { api_key } &format=json" conn . request ( "GET" , url ) response = conn . getresponse () if response . status == 200 : data = json . loads ( response .…

Typeface preferences and C-k

( set-frame-font "-*-Iosevka-regular-normal-normal-*-12-*-*-*-m-0-iso10646-1" ) wisdom: C-k does not copy into the global mark-ring most times.

Exporting Org Notes to Jekyll

( defun generate-file-name ( title ) ( interactive "sEnter title:" ) ( message ( format "/Some/Folder/komikat.github.io/_posts/%s-%s.md" ( format-time-string "%Y-%m-%d" ) ( replace-regexp-in-string " " "-" ( downcase title )))) ) ( defun generate-header-post ( title ) ( format "--- layout: post title: \"%s\" date: %s categories: post comments: false --- " title ( format-time-string "%Y-%m-%d…

lisp syntax highlight testing

( cons "one" "second" ) ; '("one" "second") Useful links Practical Common Lisp Relevant stack overflow

Asahi Linux Setup

Why? i3 and less clutter Display Manager and ZSH LightDM is a mess. startx after login – remove xdisplay commands and append exec i3 to .xinitrc. ZSH is the default shell. Emacs AUR has a native-comp install which works on ARM64. find it way faster than native-comp on MAC OSX, not sure why. TODO: custom emacs init functions for mac/linux IIIT Git setup IIIT has blocked the default ports on LAN,…

Hello world! (for the 7538th time)

Update This website is now serves to be my public notepad. I’ve been meaning to blog for some time now, finally went around caring enough to actually set it up and deploy. The blog also coincides with January 1st (we’re 13 days late actually but lets ignore that for a moment), a Happy New Years to you too. If you’re looking to chat, I’m eternally active on discord – komikat#5603, a few other…