atareao / funciones-bash-aresumen-rfb

0 вподобань
0 форк(-ів)
2 файл(-ів)
Остання активність 2 weeks ago
Funciones para el episodio 824: aresumen (fd+rg+Ollama) y rfb (rg+fzf+bat). atareao.es
1 # pregunta — versión Fish del pipeline IA
2 # Episodio 824 — atareao con Linux
3 #
4 # Uso: pregunta <texto>
5 # Requiere: fd, rg, jq, Ollama
6
7 # Aliases básicos para Fish
8 alias f "fd"
9 alias rg "rg --smart-case"
10 alias rga "rg -uuu"

atareao / typst-ia

0 вподобань
0 форк(-ів)
3 файл(-ів)
Остання активність 3 weeks ago
CLI en Python que genera presentaciones Typst con IA vía OpenRouter. Le dices el tema, la IA escribe el contenido, Typst lo compila a PDF.
1 #!/usr/bin/env python3
2 """
3 typst-ia: Genera presentaciones Typst con IA vía OpenRouter.
4
5 Uso:
6 typst-ia "Tema de la presentación"
7 typst-ia "Historia de Linux" --slides 10
8 typst-ia "Comandos Git" --slides 8 --model "anthropic/claude-3.5-sonnet"
9 typst-ia "Python async" --slides 10 --output python-async

atareao / rag_samples.py — Hybrid search, reranker y HyDE en Python

0 вподобань
0 форк(-ів)
3 файл(-ів)
Остання активність 3 weeks ago
Tres técnicas de RAG implementadas en Python para buscar en tu base de conocimiento: hybrid_search (FTS5 + cosine similarity con alpha), reranker (cross-encoder BAAI/bge-reranker-v2-m3), y HyDE (documentos hipotéticos con Ollama + Llama 3.2). Incluye CLI cerebro con argparse y pipe a fzf.
1 #!/usr/bin/env python3
2 """rag_reranker.py — Re-ranking con cross-encoder"""
3 from sentence_transformers import CrossEncoder
4
5 class Reranker:
6 def __init__(self, model_name="BAAI/bge-reranker-v2-m3", use_fp16=True):
7 self.model = CrossEncoder(model_name, max_length=512, device="cpu")
8
9 def rerank(self, query: str, candidates: list[dict], top_k: int = 5) -> list[dict]:
10 pairs = [(query, c["contenido"]) for c in candidates]
Новіше Пізніше