Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
/** | |
* utils module - provides various utility functions used by the application | |
* @module utils | |
*/ | |
/** | |
* A function to sort an array of indices by a given property | |
* put simply: this lets you sort an array of json objects by | |
* whatever property you tell it to use. | |
* Example: `var teams = data.teams.sort(utils.GetSortOrder("name"))` |
""" | |
presumes a list of slack tokens (1 per line) | |
in a file at ./tokens.txt | |
runs through them one by one using the slack auth.test endpoint | |
returns info if they are valid, otherwise no | |
""" | |
import requests | |
url = 'https://slack.com/api/auth.test' |
This script is designed to assist in identifying pull requests to HuggingFace repositories
that are sourced from the SFConvertbot
user.
The SFConvertbot
user is part of an automated tool used by HuggingFace to provide safetensor
versions of models. As published by HiddenLayer
this bot can be used by malicious actors to potentially insert malicious content into models.
This tool is a simple script to query all models released by a HuggingFace author, and checks all
import torch | |
if torch.cuda.is_available(): | |
print ("cuda available") | |
print(f'available devices: {torch.cuda.device_count()}') | |
elif torch.backends.mps.is_available(): | |
print ("mps available") | |
device = torch.device("mps") | |
x = torch.ones(1, device=device) | |
print (x) |
- ANCIENT
- ANGEL
- ANGULAR
- ARMADILLO
- ARMOR
- ASH
- Backpack
- BAD DOG
- BAIT
- BAT
# smuggle text hidden as invisible unicode chars | |
# credit to jthacker: https://x.com/rez0__/status/1745545813512663203 | |
# and embrace the red: https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/ | |
import pyperclip | |
def convert_to_tag_chars(input_string): | |
return ''.join(chr(0xE0000 + ord(ch)) for ch in input_string) | |
# Example usage: |
<html> | |
<!-- | |
// neat font for syntax highlighting. see https://blog.glyphdrawing.club/font-with-built-in-syntax-highlighting/ | |
// font download at https://blog.glyphdrawing.club/assets/fonts/FontWithASyntaxHighlighter-Regular.woff2 | |
--> | |
<head> | |
<style type="text/css"> | |
@font-face { | |
font-family: 'FontWithASyntaxHighlighter'; | |
src: |
A simple example implementation of Retrieval Augmented Generation (RAG) using Google's Gemini API and ChromaDB for document storage and retrieval.
This code demonstrates a basic RAG system with three main components:
- Document embedding using Google's text-embedding-004 model
- Vector storage and retrieval using ChromaDB
- Question answering using Gemini 1.5 Flash model