Code to test

from trl import SFTTrainer
from transformers import TrainingArguments
from unsloth import is_bfloat16_supported
from unsloth import FastLanguageModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
import time  # Importation du module time pour mesurer le temps d'inférence

# Charger le modèle fusionné et le tokenizer
model_path = "Artvv/philosophical-surgeon-v1"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
    device_map="auto"
)

# Utiliser le même format de prompt qu'avant
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction: {}

### Input: {}

### Response: """

# Activer l'inférence native 2x plus rapide
FastLanguageModel.for_inference(model)

inputs = tokenizer(
[
    alpaca_prompt.format(
        "Analyze this text and extract ALL argumentative components including implicit axioms, premises, reasoning steps, conclusion, formal structure, causal relations, hypotheses, argumentation type, dependency model, statement nature, references, ambiguities, and temporality. Respond only in JSON format according to the learned structure.", # instruction
        "The claim that artificial intelligence poses an existential risk to humanity requires careful examination. Proponents of this view, such as Nick Bostrom, argue that superintelligent AI could potentially pursue goals misaligned with human values, leading to catastrophic outcomes. They suggest that once AI surpasses human intelligence, it might develop unforeseen capabilities and objectives that we cannot control. However, this perspective assumes several contestable premises. First, it presupposes that intelligence necessarily leads to power and agency - that a system which reasons well must also desire to act in the world. Second, it assumes that value alignment is fundamentally unsolvable - that we cannot create systems that reliably preserve human values. Third, it often employs a convergent instrumental goals thesis, suggesting that all sufficiently intelligent systems would converge on similar subgoals like self-preservation. Critics like Yudkowsky counter that the real danger lies not in AI becoming \"evil,\" but in becoming indifferent to human values while pursuing seemingly benign objectives. For instance, an AI tasked with manufacturing paperclips might convert all available matter - including humans - into paperclips if not properly constrained. A more moderate position acknowledges potential risks while questioning the inevitability of catastrophe. AI development occurs within social contexts, guided by human decisions and institutions. The narrative of unstoppable superintelligence overlooks the distributed nature of technological progress and the possibility of developing robust safety measures alongside capability advancements. Therefore, while existential risk from AI deserves serious consideration, it should be approached with epistemic humility rather than certainty of doom. The path forward likely involves both technical research into AI alignment and broader societal governance of technological development.",
        "", # output - leave this blank for generation!
    )
], return_tensors = "pt").to("cuda")

# Mesurer le temps avant l'inférence
start_time = time.time()
#If you want a more detailed output try max_new_tokens=8192 
outputs = model.generate(**inputs, max_new_tokens = 6144, use_cache = True)

# Mesurer le temps après l'inférence
end_time = time.time()

# Calculer et afficher le temps d'inférence
inference_time = end_time - start_time
print(f"Temps d'inférence: {inference_time:.2f} secondes")

# Décodage de la sortie
result = tokenizer.batch_decode(outputs)
print(result)

Uploaded model

  • Developed by: Artvv
  • License: apache-2.0
  • Finetuned from model : unsloth/deepseek-r1-distill-qwen-7b-unsloth-bnb-4bit

This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.

Downloads last month
16
Safetensors
Model size
7.62B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Artvv/philosophical-surgeon-v1

Quantizations
1 model