YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Quantization made by Richard Erkhov.

Github

Discord

Request more models

Mistral-RAG - GGUF

Name Quant method Size
Mistral-RAG.Q2_K.gguf Q2_K 2.53GB
Mistral-RAG.IQ3_XS.gguf IQ3_XS 2.81GB
Mistral-RAG.IQ3_S.gguf IQ3_S 2.96GB
Mistral-RAG.Q3_K_S.gguf Q3_K_S 2.95GB
Mistral-RAG.IQ3_M.gguf IQ3_M 3.06GB
Mistral-RAG.Q3_K.gguf Q3_K 3.28GB
Mistral-RAG.Q3_K_M.gguf Q3_K_M 3.28GB
Mistral-RAG.Q3_K_L.gguf Q3_K_L 3.56GB
Mistral-RAG.IQ4_XS.gguf IQ4_XS 3.67GB
Mistral-RAG.Q4_0.gguf Q4_0 3.83GB
Mistral-RAG.IQ4_NL.gguf IQ4_NL 3.87GB
Mistral-RAG.Q4_K_S.gguf Q4_K_S 3.86GB
Mistral-RAG.Q4_K.gguf Q4_K 4.07GB
Mistral-RAG.Q4_K_M.gguf Q4_K_M 4.07GB
Mistral-RAG.Q4_1.gguf Q4_1 4.24GB
Mistral-RAG.Q5_0.gguf Q5_0 4.65GB
Mistral-RAG.Q5_K_S.gguf Q5_K_S 4.65GB
Mistral-RAG.Q5_K.gguf Q5_K 4.78GB
Mistral-RAG.Q5_K_M.gguf Q5_K_M 4.78GB
Mistral-RAG.Q5_1.gguf Q5_1 5.07GB
Mistral-RAG.Q6_K.gguf Q6_K 5.53GB
Mistral-RAG.Q8_0.gguf Q8_0 7.17GB

Original model description:

library_name: transformers license: apache-2.0 datasets: - DeepMount00/gquad_it language: - it

Mistral-RAG

  • Model Name: Mistral-RAG
  • Base Model: Mistral-Ita-7b
  • Specialization: Question and Answer Tasks

Overview

Mistral-RAG is a refined fine-tuning of the Mistral-Ita-7b model, engineered specifically to enhance question and answer tasks. It features a unique dual-response capability, offering both generative and extractive modes to cater to a wide range of informational needs.

Capabilities

Generative Mode

  • Description: The generative mode is designed for scenarios that require complex, synthesized responses. This mode integrates information from multiple sources and provides expanded explanations.
  • Ideal Use Cases:
    • Educational purposes
    • Advisory services
    • Creative scenarios where depth and detailed understanding are crucial

Extractive Mode

  • Description: The extractive mode focuses on speed and precision. It delivers direct and concise answers by extracting specific data from texts.
  • Ideal Use Cases:
    • Factual queries in research
    • Legal contexts
    • Professional environments where accuracy and direct evidence are necessary

How to Use

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

MODEL_NAME = "DeepMount00/Mistral-RAG"

model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, torch_dtype=torch.bfloat16).eval()
model.to(device)
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)

def generate_answer(prompt, response_type="generativo"):
    # Creazione del contesto e della domanda in base al tipo di risposta
    if response_type == "estrattivo":
        prompt = f"Rispondi alla seguente domanda in modo estrattivo, basandoti esclusivamente sul contesto.\n{prompt}"
    else:
        prompt = f"Rispondi alla seguente domanda in modo generativo, basandoti esclusivamente sul contesto.\n{prompt}"

    # Preparazione del messaggio per il modello
    messages = [
        {"role": "user", "content": prompt},
    ]
    model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device)
    generated_ids = model.generate(model_inputs, max_new_tokens=200, do_sample=True,
                                   temperature=0.001, eos_token_id=tokenizer.eos_token_id)
    decoded = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
    return decoded[0].split("[/INST]", 1)[1].strip() if "[/INST]" in decoded[0] else "Errore nella generazione della risposta"



# Esempio di utilizzo con la nuova funzionalità
contesto = """Venerdì più di 2.100 persone che vivono vicino a un vulcano in Indonesia sono state sfollate per i rischi legati a un’eruzione. Martedì infatti l’isola vulcanica di Ruang, che si trova circa 100 chilometri a nord di Sulawesi, ha cominciato a eruttare, producendo una colonna di fumo e ceneri che ieri ha raggiunto 1.200 metri di altezza. Le operazioni di evacuazione sono ancora in corso: complessivamente sono più di 11mila le persone a cui è stato detto di lasciare le proprie case. Gran parte di loro vive sulla vicina isola di Tagulandang, che in totale ha 20mila abitanti; potrebbe essere raggiunta non solo dalle ceneri vulcaniche e dai piroclasti, ma anche da un eventuale tsunami causato dalla caduta in mare di lava e rocce."""
domanda = "Perchè le persone sono evacuate dalle case?"
prompt = f"Contesto: {contesto}\nDomanda: {domanda}"


answer = generate_answer(prompt, "estrattivo")
print(answer)

Developer

[Michele Montebovi]

Downloads last month
81
GGUF
Model size
7B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

2-bit

3-bit

4-bit

5-bit

6-bit

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support