Views
No views yet
meta-llama/Llama-3.1-8B-Instructpretrainbothmeta-llama/Llama-3.1-8B-Instruct is loaded from Hugging Face at runtime.1from modelling_pisco import COCOM
2
3# If you pushed this folder to the Hub, use the repo id:
4# repo_or_path = "jeongseokoh/Llama-3.1-8B-Instruct_kv_pretrain_both_ce1_compr32_best"
5#
6# Otherwise, load locally from this checkpoint folder:
7repo_or_path = "."
8
9model = COCOM.from_pretrained(repo_or_path).to("cuda")
10
11documents = [[
12 "Doc A text ...",
13 "Doc B text ..."
14]]
15questions = ["Question text ..."]
16
17out = model.generate_from_text(
18 questions=questions,
19 documents=documents,
20 max_new_tokens=64,
21)
22print(out)1embs = model.compress_documents(documents=documents[0])
2out = model.generate_from_compressed_documents_and_questions(
3 questions=questions,
4 compressed_documents=embs,
5 max_new_tokens=64,
6)