Feature Request: SuperCompress prompt preprocessing for llama-cpp-python

Aperta
#2,326 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
ai, backend

Direzione di ricerca

Start with the README or examples for llama-cpp-python and inspect how examples call llama.create_completion(). Add an example that compresses a prompt with SuperCompress before passing it to the completion call, following the integration shown in the issue. Done when the example demonstrates the compression flow and can be followed by users with both packages installed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature: Prompt Compression for llama-cpp-python

Problem: llama-cpp-python users often work with local models that have limited context (2048-4096 tokens). Long prompts waste valuable context window space.

Proposed Solution: Provide a SuperCompress integration example that compresses prompts before passing them to llama.create_completion().

from supercompress import Compressor
from llama_cpp import Llama

compressor = Compressor()
llm = Llama(model_path="./model.gguf")

compressed_prompt = compressor.compress(long_prompt, query)
output = llm.create_completion(compressed_prompt)

Benefits:

Lingua principale
Python
Stelle
10.7k
Fork
1.5k
Merge medio
1h 40m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di abetlen/llama-cpp-python

Tutte le issue di abetlen/llama-cpp-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.