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 json | |
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
story = "" | |
question = "" | |
model_id = "namespace-Pt/activation-beacon-llama2-7b-chat" | |
# long context | |
with open("data/book/dinosaurs.txt", encoding="utf-8") as f: | |
story_all = f.read() | |
story_all = story_all[:108448] #32k |
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 redis | |
class RedisStorage(object): | |
_redis_pool = {} | |
@classmethod | |
def setup_redis_pool(cls, redis_pool): | |
for k, v in redis_pool.iteritems(): | |
cls._redis_pool[k] = redis.Redis(v[0], v[1]) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <mach/mach_traps.h> | |
#include <mach/mach_init.h> | |
#include <mach/mach_error.h> | |
void hexToBytes(const char* hex, uint8_t** buffer, size_t* bytes) { | |
*bytes = strlen(hex) / 2; | |
*buffer = (uint8_t*) malloc(*bytes); |
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 python | |
import logging | |
from scapy.all import * | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
fakeip = ["4.36.66.178", "8.7.198.45", "37.61.54.158", "46.82.174.68", "59.24.3.173", "64.33.88.161", "64.33.99.47", "64.66.163.251", "65.104.202.252", "65.160.219.113", "66.45.252.237", "72.14.205.104", "72.14.205.99", "78.16.49.15", "93.46.8.89", "128.121.126.139", "159.106.121.75", "169.132.13.103", "192.67.198.6", "202.106.1.2", "202.181.7.85", "203.161.230.171", "207.12.88.98", "208.56.31.43", "209.145.54.50", "209.220.30.174", "209.36.73.33", "211.94.66.147", "213.169.251.35", "216.221.188.182", "216.234.179.13"] | |
testdomain = ["twitter.com", "facebook.com", "youtube.com"] | |
dnshost = "8.8.8.8" | |
for h in testdomain: |
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
''' | |
Copyright 2010 Josiah Carlson | |
Released into the public domain | |
copy_redis.py | |
A convenient utility function for copying data from one redis server to | |
another. | |
Requires http://github.com/andymccurdy/redis-py . |