264 karma · joined May 8, 2021 (5y ago) · 45 submissions
comment 1w ago · link · parent
Edit: HN stripped the characters in question from my comment
comment 1w ago · link · parent
Unfortunately mintty is the only terminal emulator I'm aware of which supports overstrike [0], as this would open up a world of new possibilities for TUI apps if more widely supported.
[0] https://github.com/mintty/mintty/wiki/CtrlSeqs#overstrike
comment 4mo ago · link · parent
The model appears to be similar to MiniLM-L6 (384 dimension, 6 transformer layers) but uses RoBERTa/GPT-2 style embedding/tokenization (50265 vocab size), used for binary classification, and quantized to INT8.
My guess is that is was distilled from roberta-base, then fine-tuned on freely available pile like artem9k/ai-text-detection-pile or similar.
It's a nice model - I've just used it to create a browser extension which highlights text based on how likely it is to be LLM genereated.
Edit - a quick google search reveals ibm-granite/granite-embedding-30m-english with the same architecture: slap a binary classification head on, fine tune, job done.
comment 5mo ago · link · parent
I'm working on what is effectively a fork of prompt_toolkit [1], which supports many modern terminal features I needed for euporie [2], such as terminal graphics, extra text styles, color palette detection, terminal clipboard, synchronized outputs, CSI-u, mouse pixel positioning, etc.
I'd be very interested to test it's performance and to read your code (I'm not an AI, promise :)
[1] https://github.com/joouha/euporie/tree/dev/packages/apptk
comment 6mo ago · link · parent
You can use euporie-console for a REPL-like terminal experience (still with rich outputs) if you don't want the full notebook experience.
You can also select the `local-python` kernel in euporie to run code using the local Python interpretor which runs euporie, instead of connecting to a Jupyter kernel.
> And when you run a project with ssh, there are ways to give access to other users with user:password if I may ask?
> I also wish to ask if there is a way to sign in to jupyter instance like that itself perhaps?
euporie-hub supports spawning notebook instances for connected users, but I haven't implemented collaborative editing like JupyterLab supports (yet). I believe that jpterm [1] might support this.
comment 6mo ago · link · parent
comment 6mo ago · link · parent
I agree that the addition of sending custom glyphs to the terminal is potentially problematic.
comment 6mo ago · link · parent
[1] https://rapha.land/introducing-glyph-protocol-for-terminals/
comment 6mo ago · link · parent
comment 8mo ago · link · parent
There are a couple of example of this readme: (1) modifing the TextWrapper object but then use it through the textwrap library's wrap() function, and (2) modifing the requests Session object, but then just using the standard requests.get(). Without modshim (using standard monkey-patching) you would have to re-implement the wrap and get methods in order to bind the new TextWrapper / Session classes.
comment 8mo ago · link · parent
One of its intended use cases is bridging contribution gaps: while contributing upstream is ideal, maintainers may be slow to merge contributions for various reasons. Forking in response creates a permanent schism and a significant maintenance burden for what might be a small change. Modshim would allow you to create a new Python package containing only the fixes for your bugbears, while automatically inheriting the rest from upstream httpx.
comment 11mo ago · link · parent
I use it as a fallback option for terminals without proper terminal graphics support in my TUI Jupyter client, euporie.
There are Python bindings available: https://github.com/GuardKenzie/chafa.py
18.
Show HN: Euporie-lite, Jupyter notebooks in terminal in the browser(euporie.readthedocs.io ↗)
3 points · by joouha · 11mo ago · 2 comments
comment 1y ago · link · parent
This would allow TUIs to use recent unicode characters which may not be supported (e.g. Symbols for Legacy Computing), or private use characters (e.g. powerline symbols & font-awesome icons), while falling back to a more universally supported character in terminals that do not support them.
comment 1y ago · link · parent
I've written a Jupyter client for the terminal (euporie), for which I've had to employ monkey-patching of various third-party packages to achieve my goals and avoid forking those packages. For example, I've added terminal graphics support & HTML/CSS rendering to prompt-toolkit (a Python TUI library), and I've changed aiohttp to not raise errors on non-200 http responses. These are things the upstream package maintainers do not want to maintain or will not implement, and likewise I do not want to maintain forks of these packages.
So far I've got away with monkey-patching, but recently I implemented a kernel for euporie which runs on the local interpreter (the same interpreter as the application itself). This means that my patches are exposed to the end user in a REPL, resulting in potentially unexpected behaviour for users when using certain 3rd party packages in Python through euporie. Modshim will allow me to keep my patched versions isolated from the end user.
Additionally, I would like to publish some of my patches to prompt_toolkit as a new package extending prompt_toolkit, as I think they would be useful to others building TUI applications. However, the changes required need to be deeply integrated to work, which would mean forking prompt_toolkit (something I'd like to avoid). modshim will make it possible for me to publish just my modifications.
Perhaps it's a somewhat niche use-case, and modshim is not something most Python users would ever need to use. I just thought it was something novel enough to be of interest to other HN users.
> messing around with import internals in python is extremely tricky to get right
This is true! modshim has been the most complicated thing I've written by some way!
23.
Show HN: Modshim – A new alternative to monkey-patching in Python(github.com ↗)
109 points · by joouha · 1y ago · 30 comments
comment 2y ago · link · parent
comment 2y ago · link · parent
I guess most shells (bash, zsh, etc.) keep things "traditional" for backwards compatibility reasons.
comment 2y ago · link · parent
It would be good if there was more emphasis on graceful degradation in TUI libraries, such as falling back to ASCII art when terminal graphics are not supported.
> Some new TUI libraries, such as vaxis, are designed specifically to avoid using terminfo at all and exclusively use queries to determine feature capabilities.
I take this approach in euporie [1], having encountered the same issues with using terminfo as discussed. However, there were a few terminal features which I could not find a way to query - iTerm2 graphics support, for example.
comment 2y ago · link · parent
https://github.com/joouha/euporie
It consists of a TUI editor (and interactive REPL) for Jupyter notebooks, and supports displaying rich output in the terminal (images, LaTeX, HTML, interactive widgets, etc.).