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 | |
import os | |
import time | |
from typing import List, Dict, Any | |
from functools import partial | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import torch | |
import torch.nn.functional as F |
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 complexity.file_utils import get_project_root, load_env_file | |
import torch | |
from transformers import ( | |
DistilBertTokenizerFast, | |
DistilBertForSequenceClassification | |
) | |
from loguru import logger | |
import os | |
import time # Add this at the top with other imports |
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
[ | |
{ | |
"type": "Heading", | |
"children": [ | |
{ | |
"type": "RawText", | |
"children": [], | |
"content": "Paris: The Enchanting Capital of France" | |
} | |
], |
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 { Action, Detail, LaunchProps } from "@raycast/api"; | |
import { getConfig } from "./utils/preferences"; | |
interface Preferences { | |
obsidianVaultPath: string; | |
} | |
export default function ResultView(props: LaunchProps<{ context: { answer: string } }>) { | |
const { obsidianVaultPath } = getConfig(); | |
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/osascript | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title GlobiTab | |
# @raycast.mode silent | |
# @raycast.icon π | |
# @raycast.packageName GlobiTab | |
# @raycast.argument1 { "type": "text", "placeholder": "Tab Name/URL/Keyword", "optional": false } |
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
#!/bin/bash | |
# Description: | |
# A Raycast script for quickly finding environment variables in .env files. | |
# Matches keys in three ways: | |
# 1. Abbreviations: "aak" β "AWS_ACCESS_KEY", "gpt" β "GITHUB_PAT_TOKEN" | |
# 2. Partial matches: "shap" β "SHAPE", "aws" β "AWS_KEY" | |
# 3. Fuzzy finding: "ath" β "AUTH_TOKEN" | |
# Matched values are copied to clipboard and printed to terminal using pbcopy (brew install pbcopy or similar) |
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
LET results = ( | |
// Get embedding results | |
LET embedding_results = ( | |
FOR doc IN glossary_view | |
LET similarity = COSINE_SIMILARITY(doc.embedding, @embedding_search) | |
FILTER similarity >= @embedding_similarity_threshold | |
SORT similarity DESC | |
LIMIT @top_n | |
RETURN { | |
doc: doc, |
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 os | |
from loguru import logger | |
from typing import List, Dict | |
def load_aql_query(filename: str) -> str: | |
""" | |
Load an AQL query from a file. | |
""" | |
try: | |
file_path = os.path.join("app/backend/vllm/beta/utils/aql", filename) |
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
# Doesn't Work. Outputs are garbled | |
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
from peft import PeftModel | |
from loguru import logger | |
# Configuration | |
BASE_MODEL_NAME = "unsloth/Phi-3.5-mini-instruct" | |
ADAPTER_PATH = "/home/grahama/dev/vllm_lora/training_output/Phi-3.5-mini-instruct_touch-rugby-rules_adapter/final_model" |
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 os | |
import torch | |
import gc | |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline | |
from peft import PeftModel | |
from huggingface_hub import snapshot_download | |
from transformers import ( | |
AutoModelForCausalLM, | |
AutoTokenizer, | |
pipeline, |