This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import lru_cache | |
| @lru_cache # Stores previously computed factorials | |
| def factorial(num): | |
| if num < 2: | |
| return 1 | |
| return num * factorial(num - 1) | |
| def N(C, m_2, m_1, m_0): | |
| count = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function num_tokens { | |
| prun python -c 'import sys; import tiktoken; s = "\n".join([line for line in sys.stdin]); encoding = tiktoken.get_encoding("cl100k_base"); print(len(encoding.encode(s)))' | |
| } | |
| # e.g., `echo "Hello World!" | num_tokens` | |
| # this should give 3 tokens. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.julia/config/startup.jl | |
| ### REPL CUSTOMIZATION | |
| isinteractive() && VERSION < v"1.13.0-" && @eval begin | |
| """ | |
| ShellSpecification{is_windows, shell} | |
| A type used for dispatch to select the appropriate shell command preparation logic. | |
| It is parameterized by `is_windows::Bool` indicating the operating system, | |
| and `shell::Symbol` representing the basename of the shell executable. |
OlderNewer