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 ibis | |
| conn = ibis.connect("duckdb://") # bigguery://, snowfalke://, etc | |
| # load penguin data | |
| penguins = conn.read_csv( | |
| "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/penguins.csv" | |
| ) | |
| # query: find female penguins heavier than their species average |
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 typing import NamedTuple | |
| import httpx | |
| from smolagents import CodeAgent, LiteLLMModel, Tool | |
| class Coordinates(NamedTuple): | |
| latitude: float | |
| longitude: float | |
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 typing import NamedTuple | |
| from smolagents import CodeAgent, LiteLLMModel, Tool | |
| class Coordinates(NamedTuple): | |
| latitude: float | |
| longitude: float | |
| model = LiteLLMModel( |
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.12" | |
| # dependencies = [ | |
| # "aioclock", | |
| # "diskcache", | |
| # "httpx", | |
| # ] | |
| # /// | |
| from contextlib import asynccontextmanager |
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.12" | |
| # dependencies = [ | |
| # "aioclock", | |
| # "diskcache", | |
| # "httpx", | |
| # ] | |
| # /// | |
| from typing import Any |
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 -S uv run --quiet --script | |
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "httpx", | |
| # "jmespath", | |
| # "rich", | |
| # ] | |
| # /// |
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.12" | |
| # dependencies = [ | |
| # "httpx", | |
| # "rich", | |
| # ] | |
| # /// | |
| # script require llama.cpp: > llama-server -hf ggml-org/SmolVLM-500M-Instruct-GGUF --n-predict -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
| """ To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory | |
| git clone https://github.com/myshell-ai/OpenVoice | |
| cd OpenVoice | |
| git clone https://huggingface.co/myshell-ai/OpenVoice | |
| cp -r OpenVoice/* . | |
| pip install whisper pynput pyaudio | |
| """ | |
| from openai import OpenAI | |
| import time |
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 | |
| sudo apt update -y | |
| sudo apt install git gcc make openssl libssl-dev \ | |
| libbz2-dev libreadline-dev libsqlite3-dev zlib1g-dev \ | |
| libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev \ | |
| tk-dev libssl-dev openssl libffi-dev \ | |
| -y | |
| # install |
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 zlib | |
| from typing import Any, Optional, Dict | |
| import diskcache as dc | |
| class DataCache: | |
| def __init__( | |
| self, | |
| cache_path: str, |
NewerOlder