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
| """Blocklist containing regex patterns for filtering AI safety-related content. | |
| This module defines lists of terms (regular expression patterns) used to quickly | |
| filter documents that may contain content related to AI safety, existential risks, | |
| misaligned AI systems, and related concepts. | |
| See the filters.py gist for the logic. Some of these blocklist categories have more advanced logic, | |
| while, for others, the documents is filtered if it contains any key terms. | |
| """ |
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 sklearn.metrics import classification_report, confusion_matrix | |
| from datasets import load_dataset, concatenate_datasets, Dataset, DatasetDict | |
| from vllm import LLM, SamplingParams | |
| from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM | |
| from tqdm import tqdm | |
| import torch.distributed as dist | |
| from datetime import timedelta | |
| import pandas as pd | |
| import torch | |
| import re |
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 datasets import load_dataset, DatasetDict, Dataset, BuilderConfig, GeneratorBasedBuilder | |
| import pandas as pd | |
| from tqdm import tqdm | |
| import os | |
| def format_line(raw_line): | |
| split_line = raw_line.split("\\n") | |
| max_length = 8 | |
| if len(split_line) < max_length: |
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
| def get_model_perplexities(split_name): | |
| memories = load_dataset("EleutherAI/pythia-memorized-evals")[split_name] | |
| device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| tokenizer = load_tokenizer(split_name) | |
| pythia_model = load_model(split_name) | |
| memories_dataset = HFMemoriesDataset(memories, tokenizer) | |
| data_loader = DataLoader(memories_dataset, batch_size=128) | |
| all_perplexities = [] | |
| with torch.no_grad(): |
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
| bierner.markdown-preview-github-styles | |
| bungcip.better-toml | |
| ckolkman.vscode-postgres | |
| DavidAnson.vscode-markdownlint | |
| dbaeumer.vscode-eslint | |
| Equinusocio.vsc-material-theme | |
| esbenp.prettier-vscode | |
| karyfoundation.comment | |
| mauve.terraform | |
| ms-mssql.mssql |
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
| { | |
| "workbench.colorTheme": "Material Theme", | |
| "workbench.colorCustomizations": { | |
| "terminal.foreground": "#C3FF99" | |
| }, | |
| "files.autoSave": "afterDelay", | |
| "editor.formatOnSave": true, | |
| "javascript.format.enable": false, | |
| "eslint.autoFixOnSave": true, | |
| "eslint.alwaysShowStatus": 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
| import requests | |
| import json | |
| import os | |
| headers = { | |
| "developerkey": os.environ["REMOTEIT_DEVELOPER_KEY"], | |
| "token": os.environ["REMOTEIT_TOKEN"] | |
| } | |
| body = { | |
| "deviceaddress": "80:00:00:3F:AE:00:00:11" |
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 requests | |
| import json | |
| import os | |
| | |
| headers = { | |
| "developerkey": os.environ["REMOTEIT_DEVELOPER_KEY"] | |
| } | |
| body = { | |
| "password": os.environ["REMOTEIT_PASSWORD"], | |
| "username": os.environ["REMOTEIT_USERNAME"] |
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 requests | |
| import os | |
| headers = { | |
| "developerkey": os.environ["REMOTEIT_DEVELOPER_KEY"], | |
| "token": os.environ["REMOTEIT_TOKEN"] | |
| } | |
| url = "https://api.remot3.it/apv/v27/device/list/all" |
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
| using System; | |
| using System.Net.Http; | |
| using Newtonsoft.Json; | |
| using System.Collections.Generic; | |
| namespace remote.it_api_example | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) |
NewerOlder