Views
No views yet
Pisco-mistral1from transformers import AutoModel
2
3pisco = AutoModel.from_pretrained('naver/pisco-mistral').to('cuda')
4
5# Example documents and question:
6documents = [
7 [
8 "Weldenia is a monotypic genus of flowering plant in the family Commelinaceae, first describ ed in 1829. It has one single species: Weldenia candida, which grows originally in Mexico and Guatemala.",
9 "Hagsatera is a genus of flowering plants from the orchid family, Orchidaceae. There are two known species, native to Mexico and Guatemala",
10 "Alsobia is a genus of flowering plants in the family Gesneriaceae, native to Mexico, Guatemala and Costa Rica. The two species are succulent, stoloniferous herbs and were previously included in the genus \"Episcia\". Recent molecular studies have supported the separation of \"Alsobia\" from \"Episcia\""
11 ]
12]
13
14questions = ["Which genus of plant grows originally in Mexico and Guatemala, Phylica or Weldenia?"]
15
16# End-to-end usage
17out = pisco.generate_from_text(questions=questions, documents=documents, max_new_tokens=64)
18print('Generated answer', out)
19
20# Document compression:
21embeddings = pisco.compress_documents(documents=documents[0])
22
23# Generation from compressed documents:
24out = pisco.generate_from_compressed_documents_and_questions(questions=questions, compressed_documents=embeddings)@article{louis2025pisco,
title={Pisco: Pretty simple compression for retrieval-augmented generation},
author={Louis, Maxime and D{\'e}jean, Herv{\'e} and Clinchant, St{\'e}phane},
journal={arXiv preprint arXiv:2501.16075},
year={2025}
}