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, |
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
2024-12-20 09:39:32.640 | INFO | __main__:run_curl_version:10 - | |
=== Running curl version === | |
2024-12-20 09:39:32.641 | INFO | __main__:run_curl_version:43 - Initial request time: 0.00 seconds | |
2024-12-20 09:39:32.641 | INFO | __main__:run_curl_version:47 - Response tokens: | |
To determine the number of rugby players on a touch rugby team, we can refer to the relevant section of the document. | |
1. **Understanding Team Composition**: The document states that a team consists of a maximum of 14 players. However, this number includes reserves, meaning that only six (6) players are allowed on the field at any given time during a match. | |
2. **Player Limitation**: Additionally, teams are encouraged to include mixed genders (four males and four females), indicating that2024-12-20 09:39:43.862 | INFO | __main__:run_curl_version:68 - | |
Tokens generated: 100 |
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 pathlib import Path | |
from dotenv import load_dotenv | |
def get_project_root(marker_file=".git"): | |
""" | |
Find the project root directory by looking for a marker file. | |
Args: | |
marker_file (str): File/directory to look for (default: ".git") |
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 asyncio | |
from loguru import logger | |
from verifaix.arangodb_helper.arango_client import connect_to_arango_client | |
async def truncate_cache_collection(arango_config, db=None): | |
logger.info(f"Attempting to truncate cache collection '{arango_config['cache_collection_name']}'") | |
if db is None: | |
logger.info(f"Connecting to ArangoDB at {arango_config['host']}") | |
db = await asyncio.to_thread(connect_to_arango_client, arango_config) |
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 asyncio | |
from loguru import logger | |
from verifaix.arangodb_helper.arango_client import connect_to_arango_client | |
async def truncate_cache_collection(arango_config, db=None): | |
logger.info(f"Attempting to truncate cache collection '{arango_config['cache_collection_name']}'") | |
if db is None: | |
logger.info(f"Connecting to ArangoDB at {arango_config['host']}") | |
db = await asyncio.to_thread(connect_to_arango_client, arango_config) |
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 asyncio | |
import os | |
import runpod | |
from datetime import datetime, timedelta, timezone | |
from dotenv import load_dotenv | |
from loguru import logger | |
from tenacity import retry, stop_after_attempt, wait_fixed, retry_if_exception_type | |
from verifaix.llm_client.get_litellm_response import get_litellm_response | |
from verifaix.arangodb_helper.arango_client import ( | |
connect_to_arango_client, |