Views
No views yet

es-ES | Name | Quant method | Bits | Size | Max RAM required | Use case |
|---|---|---|---|---|---|
| gua-a_v0.1-ft_mistral-7b_q4_K_M.gguf | Q4_K_M | 4 | 4.37 GB | 4.16 GB | medium, balanced quality - recommended |
Responde a preguntas de forma clara, amable, concisa y solamente en el lenguaje español, sobre el libro Ñande Ypykuéra.
Contexto
-------------------------
{}
-------------------------
### Pregunta:
{}
### Respuesta:
{}
1# Si vas a utilizar solo CPU
2pip install llama-cpp-python
3
4# Si tienes una GPU basada en NVidia CUDA acceleration
5CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
6
7# O con OpenBLAS acceleration
8CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
9# O con CLBLast acceleration
10CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
11# O con AMD ROCm GPU acceleration (Linux only)
12CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
13# O con Metal GPU acceleration for macOS systems only
14CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
15
16# En windows, ejemplo para NVidia CUDA:
17$env:CMAKE_ARGS = "-DLLAMA_CUBLAS=on"
18pip install llama-cpp-pythonfrom llama_cpp import Llama
llm = Llama(
model_path="./gua-a_v0.1-ft_mistral-7b_q4_K_M.gguf", # Primero debes descargar el modelo
n_ctx=512, # Máximo tamaño del contexto
n_threads=2, # Número de CPUs a usar
n_gpu_layers=0 # El número de capas usadas para la GPU, si es "-1" utilizará todas las capas en la GPU, si es "0" solo se utilizará la CPU.
)
prompt = f"""Responde a preguntas de forma clara, amable, concisa y solamente en el lenguaje español, sobre el libro Ñande Ypykuéra.
Contexto
-------------------------
{context}
-------------------------
### Pregunta:
{query}
### Respuesta:
"""
contexto = ""
pregunta = "Quién es gua'a?"
# Ejemplo Simple de Inferencia
output = llm(prompt.format(context=contexto, query=pregunta),
max_tokens=512,
stop=["</s>"],
echo=True
)
respuesta = output['choices'][0]['text'].split("### Respuesta:\n")[1]
print(respuesta)