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 sentence_transformers import ( | |
| SentenceTransformer, | |
| export_optimized_onnx_model, | |
| export_dynamic_quantized_onnx_model, | |
| ) | |
| # 1. Load the model to be optimized with the ONNX backend | |
| model = SentenceTransformer( | |
| "IEITYuan/Yuan-embedding-2.0-en", | |
| backend="onnx", |
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 | |
| # | |
| # Mobile Claude - One-command setup for running Claude Code remotely | |
| # Supports: Arch, Ubuntu/Debian, Fedora, macOS | |
| # | |
| # Usage: curl -fsSL https://gist.github.com/thomasht86/86f0f8f62db1839054abd8a7e501ff7d/raw/935bbfa0957cd5926751742189441cf10fbe2ba0/setup.sh | bash | |
| # | |
| set -e |
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
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "mteb", | |
| # "pyvespa", | |
| # ] | |
| # /// | |
| import logging | |
| from typing import Any, Optional |
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 | |
| # /// script | |
| # requires-python = ">=3.13" | |
| # dependencies = [ | |
| # "textual", | |
| # ] | |
| # /// | |
| # -*- coding: utf-8 -*- | |
| """ |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>How to Destroy BM25 With One Document</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
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
| # /// script | |
| # requires-python = ">=3.9" | |
| # dependencies = [ | |
| # "matplotlib", | |
| # "pandas", | |
| # "requests", | |
| # ] | |
| # /// | |
| # Create a standalone PNG with just the monthly downloads chart |
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
| # main.py | |
| from fasthtml.common import * | |
| from dataclasses import dataclass, field, fields | |
| from datetime import date | |
| from typing import Text | |
| # 1. App Initialization | |
| # fast_app() provides the app and route decorator objects. | |
| # hdrs can be used to add global CSS or JS. PicoCSS is included by default. | |
| app, rt = fast_app() |
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 argparse | |
| from pathlib import Path | |
| def walk(path: Path, prefix: str = "") -> None: | |
| """Recursively print a tree representation of *path*.""" | |
| # Sort so that directories appear before files, both alphabetically | |
| entries = sorted(path.iterdir(), key=lambda p: (not p.is_dir(), p.name.lower())) | |
| last_idx = len(entries) - 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
| [ | |
| { | |
| "query_text": "which health care system provides all citizens or residents with equal access to health care services", | |
| "candidate_documents": [ | |
| { | |
| "text": "0. : A Regulatory Cost Recovery Charge of up to $1.25 or a Regulatory Programs Charge of $1.75 is assessed by AT&T and is not a tax or government-mandated charge. This charge is subject to change from time to time as the cost of compliance changes.The purpose of the charge is to defray AT&T's costs associated with payment of fees and compliance with various initiatives imposed by the government.his charge is subject to change from time to time as the cost of compliance changes. The purpose of the charge is to defray AT&T's costs associated with payment of fees and compliance with various initiatives imposed by the government.", | |
| "relevant": false | |
| }, | |
| { | |
| "text": "At the end of a sensational trial, former football star O.J. Simpson is acquitted of the brut |
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
| # /// script | |
| # dependencies = [ | |
| # "certifi==2024.2.2", | |
| # "cffi==1.16.0", | |
| # "charset-normalizer==3.3.2", | |
| # "cryptography==42.0.7", | |
| # "idna==3.7", | |
| # "pycparser==2.22", | |
| # "pyOpenSSL==24.1.0", | |
| # "requests==2.32.3", |
NewerOlder