Model Card for Orapi Maintenance Chatbot

The Orapi Maintenance Chatbot is a fine-tuned language model designed to assist users in selecting appropriate maintenance products from the Orapi catalog. It provides recommendations based on user queries about tasks (e.g., cleaning, assembling) and specific conditions (e.g., surface type, constraints like grease type). The model is fine-tuned from Mistral-7B-Instruct-v0.1 using the PEFT library with LoRA for efficient adaptation.

Model Details

Model Description

This model is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.1, a 7-billion-parameter language model developed by Mistral AI. It has been adapted using the Parameter-Efficient Fine-Tuning (PEFT) library with Low-Rank Adaptation (LoRA) to specialize in recommending maintenance products from the Orapi catalog. The fine-tuning dataset consists of approximately 1000 product entries, including product names, codes, functions, and claims in French. The model is designed to answer user queries in a conversational manner, providing detailed product recommendations tailored to specific maintenance tasks and conditions.

  • Developed by: Jeremy Indelicato (tacituzn999 on Hugging Face)
  • Funded by [optional]: [More Information Needed]
  • Shared by [optional]: [More Information Needed]
  • Model type: Causal Language Model (fine-tuned with LoRA)
  • Language(s) (NLP): French (based on the dataset provided, which includes French product descriptions and claims)
  • License: [More Information Needed] (Mistral-7B-Instruct-v0.1 has a gated license; you may need to specify your own license for the fine-tuned model)
  • Finetuned from model [optional]: mistralai/Mistral-7B-Instruct-v0.1

Model Sources [optional]

  • Repository: [More Information Needed] (e.g., a GitHub repository or Hugging Face model hub link if you upload the model)
  • Paper [optional]: Not applicable
  • Demo [optional]: [More Information Needed] (e.g., a link to a deployed demo if you host the chatbot online)

Uses

Direct Use

The Orapi Maintenance Chatbot is intended for direct use by maintenance professionals, technicians, or anyone seeking product recommendations for industrial maintenance tasks. Users can interact with the chatbot through a web interface, asking questions like "Quel produit recommandez-vous pour nettoyer des graisses sur un moteur ?" The model responds with a detailed recommendation, including the product name, code, function, and advantages.

Downstream Use [optional]

The model can be integrated into larger systems, such as a customer support platform for Orapi, to provide automated product recommendations. It could also be further fine-tuned for additional tasks, such as generating product documentation or answering more complex technical queries.

Out-of-Scope Use

The model is not designed for general-purpose conversation or tasks outside the domain of Orapi maintenance products. It should not be used for critical decision-making without human oversight, as it may not account for all safety or regulatory considerations. Misuse could include using the model to provide recommendations for unrelated domains (e.g., medical advice) or attempting to generate harmful content.

Bias, Risks, and Limitations

  • Technical Limitations:

    • The model was fine-tuned on a relatively small dataset (1000 products), which may limit its ability to generalize to edge cases or products not well-represented in the dataset.
    • The model relies on the quality of the input data (e.g., product descriptions and claims). Inaccurate or incomplete data may lead to suboptimal recommendations.
    • Performance may degrade if the user query is ambiguous or poorly formatted.
    • The model requires significant computational resources (GPU with CUDA support for efficient inference with 4-bit quantization, or substantial RAM for CPU inference).
  • Sociotechnical Risks:

    • The model may inadvertently reflect biases present in the training data, such as over-recommending certain products if they are over-represented in the dataset.
    • Users may overly rely on the model’s recommendations without verifying them, potentially leading to incorrect product usage.

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. Recommendations should be cross-verified with official Orapi documentation or a human expert, especially for critical maintenance tasks. To mitigate biases, the training dataset could be expanded to include a more diverse set of products and use cases. Additionally, users should be encouraged to provide clear and specific queries to improve the quality of recommendations.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch

# Configuration pour la quantification 4-bit (nécessite un GPU avec CUDA)
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.float16
)

# Votre token Hugging Face (nécessaire pour accéder au modèle de base)
hf_token = "hf_xxxxxxxxxxxxxxxxxxxxxxxxxx"  # Remplacez par votre token

# Chemins locaux
base_model_name = "mistralai/Mistral-7B-Instruct-v0.1"
model_path = "./fine_tuned_model"  # Chemin vers le dossier du modèle fine-tuné

# Charger le tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path)

# Charger le modèle de base et appliquer les adaptateurs LoRA
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    quantization_config=bnb_config,
    device_map="auto",
    token=hf_token
)
model = PeftModel.from_pretrained(base_model, model_path)

# Fonction pour générer une réponse
def generate_response(question):
    input_text = f"[INST] {question} [/INST]"
    inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
    outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
    response = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return response.split("[/INST]")[1].strip()
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for taciturn999/OrapAI

Adapter
(427)
this model