URL Source: http://www.cs.jhu.edu/~jason/advice/write-the-paper-first.html
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
| """ | |
| example script for inference with LFM2-VL-3B model | |
| https://hf.co/LiquidAI/LFM2-VL-3B | |
| """ | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| from transformers.image_utils import load_image | |
| # Load model and processor |
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
| import argparse | |
| import webbrowser | |
| from pathlib import Path | |
| from typing import Any, Callable, Optional, Union | |
| from tokenizers import Tokenizer as RustTokenizer | |
| from tokenizers.tools import EncodingVisualizer | |
| from transformers import AutoTokenizer, PreTrainedTokenizerBase | |
| SAMPLE_TEXT = '''class DyT(nn.Module): |
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
| # Copy file contents or stdin to clipboard | |
| # Usage: cz [file] | |
| # cz file.txt - copy file to clipboard | |
| # cmd | cz - copy stdin to clipboard | |
| # Fails on: binary files, files >10MB, non-existent files | |
| cz() { | |
| if [ -z "$1" ]; then | |
| xclip -selection clipboard | |
| elif [ -f "$1" ]; then | |
| # Check if it's a text file |
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
| #!/usr/bin/env python3 | |
| """ | |
| Markdown broken link checker - properly distinguishes between URLs and file paths. | |
| """ | |
| import re | |
| import sys | |
| import argparse | |
| from pathlib import Path | |
| from typing import Dict, List, Tuple, Optional, Set, Iterator |
An adapted fn of what I use on ubuntu but leverages WSL exposing clip.exe to get stuff on your clipboard
# Copy file contents or stdin to clipboard
# Usage: cz [file]
# cz file.txt - copy file to clipboard
# cmd | cz - copy stdin to clipboard
# Fails on: binary files, files >10MB, non-existent files
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>Clock AI</title> | |
| <style> | |
| :root { | |
| --bg: #0a0b0d; | |
| --panel: #141518; |
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 transformers import AutoProcessor, AutoModelForImageTextToText | |
| from transformers.image_utils import load_image | |
| # Load model and processor | |
| model_id = "LiquidAI/LFM2-VL-1.6B" | |
| model = AutoModelForImageTextToText.from_pretrained( | |
| model_id, device_map="auto", torch_dtype="bfloat16", trust_remote_code=True | |
| ) | |
| processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True) |
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
| # Font configuration - all font settings in ONE section | |
| [font] | |
| size = 15.0 | |
| builtin_box_drawing = false # 0xProto has its own box drawing chars | |
| [font.normal] | |
| family = "0xProto" | |
| style = "Regular" | |
| [font.bold] |
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
| %%writefile emoji_search.py | |
| #!/usr/bin/env python3 | |
| """ | |
| Emoji Semantic Search CLI | |
| reqs: | |
| pip install fire sentence-transformers pandas numpy | |
| Usage: | |
| python emoji_search.py "that is flames" |
NewerOlder