Text Generation
Transformers
Safetensors
GGUF
English
qwen2
text-generation-inference
unsloth
trl
conversational
Instructions to use Artvv/philosophical-surgeon-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Artvv/philosophical-surgeon-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Artvv/philosophical-surgeon-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Artvv/philosophical-surgeon-v1") model = AutoModelForCausalLM.from_pretrained("Artvv/philosophical-surgeon-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use Artvv/philosophical-surgeon-v1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Artvv/philosophical-surgeon-v1", filename="unsloth.BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Artvv/philosophical-surgeon-v1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Artvv/philosophical-surgeon-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf Artvv/philosophical-surgeon-v1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Artvv/philosophical-surgeon-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf Artvv/philosophical-surgeon-v1:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Artvv/philosophical-surgeon-v1:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Artvv/philosophical-surgeon-v1:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Artvv/philosophical-surgeon-v1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Artvv/philosophical-surgeon-v1:Q4_K_M
Use Docker
docker model run hf.co/Artvv/philosophical-surgeon-v1:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Artvv/philosophical-surgeon-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Artvv/philosophical-surgeon-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Artvv/philosophical-surgeon-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Artvv/philosophical-surgeon-v1:Q4_K_M
- SGLang
How to use Artvv/philosophical-surgeon-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Artvv/philosophical-surgeon-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Artvv/philosophical-surgeon-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Artvv/philosophical-surgeon-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Artvv/philosophical-surgeon-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Artvv/philosophical-surgeon-v1 with Ollama:
ollama run hf.co/Artvv/philosophical-surgeon-v1:Q4_K_M
- Unsloth Studio
How to use Artvv/philosophical-surgeon-v1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Artvv/philosophical-surgeon-v1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Artvv/philosophical-surgeon-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Artvv/philosophical-surgeon-v1 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Artvv/philosophical-surgeon-v1 with Docker Model Runner:
docker model run hf.co/Artvv/philosophical-surgeon-v1:Q4_K_M
- Lemonade
How to use Artvv/philosophical-surgeon-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Artvv/philosophical-surgeon-v1:Q4_K_M
Run and chat with the model
lemonade run user.philosophical-surgeon-v1-Q4_K_M
List all available models
lemonade list
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
- 58
