Can you enable a two pipe solution for those with Unified Memory Architecture ?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- machine-learning
Direzione di ricerca
Start by reading LensPipeline.__init__ and the prompt-handling paths used by encode_prompt and pipeline invocation. Trace how configuration and optional models are loaded, then identify where None prompt inputs are converted to lists. The work is complete when text encoding can run separately, the text encoder can be removed, and prompt embeddings, masks, and negative prompts are accepted without errors.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With Diffusers style Pipelines its a common pattern to split the Pipeline into 2, one to do the text encoding and one to do run the transformer integration. This is done so we can throw the Text encoder out of memory once its been finished with.
e.g.
with torch.no_grad():
te_pipe = LensPipeline.from_pretrained(
"microsoft/Lens", torch_dtype=torch.bfloat16,
transformer=None, vae=None
).to("mps")
prompt_embeds, prompt_mask, negative_prompt_embeds, negative_prompt_mask = te_pipe.encode_prompt(
prompt=prompt,
negative_prompt=""
)
del te_pipe
import gc
gc.collect()
torch.mps.empty_cache()
gc.collect()
torch.mps.empty_cache()
pipe = LensPipeline.from_pretrained(
"microsoft/Lens", torch_dtype=torch.bfloat16,
text_encoder=None,
).to("mps")
image = pipe(
prompt_embeds=prompt_embeds,
prompt_mask=prompt_mask,
negative_prompt_embeds=negative_prompt_embeds,
negative_prompt_mask=negative_prompt_mask,
base_resolution=1440, aspect_ratio="1:1",
num_inference_steps=20, guidance_scale=5.0,
generator=torch.Generator("mps").manual_seed(0),
).images[0]
Unfortunately Lens has a few coding barriers, the init for the pipeline assumes all the models are there, using config values.
Using the prompt embeds is broken, the code that copies the prompts into list form does not have a guard for the prompt being None, and the same for the negative prompt
- Lingua principale
- Python
- Stelle
- 2
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/Lens
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 12/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Tutte le issue di microsoft/Lens
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
gramaziokohler/compas_timber#870 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
autowarefoundation/autoware_carla_scenario#500 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue priority: low size: XS testing
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
cubrid-lab/cubrid-mcp-server#385 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue priority: low size: S testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
cubrid-lab/cubrid-cookbook-python#447 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100