Views
No views yet
| hellaswag_it acc_norm | arc_it acc_norm | m_mmlu_it 5-shot acc | Average | F1 |
|---|---|---|---|---|
| 0.6474 | 0.4671 | 0.5521 | 0.555 | 69.82 |
pip install llama-cpp-python huggingface_hubCMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install huggingface_hub llama-cpp-python --force-reinstall --upgrade --no-cache-dir1from huggingface_hub import hf_hub_download
2from llama_cpp import Llama
3
4model_path = hf_hub_download(
5 repo_id="MoxoffSpA/VolareQuantized",
6 filename="Volare-ggml-Q4_K_M.gguf"
7)
8
9# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
10llm = Llama(
11 model_path=model_path,
12 n_ctx=2048, # The max sequence length to use - note that longer sequence lengths require much more resources
13 n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
14 n_gpu_layers=0 # The number of layers to offload to GPU, if you have GPU acceleration available
15)
16
17# Simple inference example
18question = """Quanto è alta la torre di Pisa?"""
19context = """
20La Torre di Pisa è un campanile del XII secolo, famoso per la sua inclinazione. Alta circa 56 metri.
21"""
22
23prompt = f"Domanda: {question}, contesto: {context}"
24
25output = llm(
26 f"[INST] {prompt} [/INST]", # Prompt
27 max_tokens=128,
28 stop=["\n"],
29 echo=True,
30 temperature=0.1,
31 top_p=0.95
32)
33
34# Chat Completion API
35
36print(output['choices'][0]['text'])