Run this model with HF Jobs
Run yoitsmeyusuf/Llama-3-Marksist-Bot-v1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use yoitsmeyusuf/Llama-3-Marksist-Bot-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yoitsmeyusuf/Llama-3-Marksist-Bot-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yoitsmeyusuf/Llama-3-Marksist-Bot-v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yoitsmeyusuf/Llama-3-Marksist-Bot-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yoitsmeyusuf/Llama-3-Marksist-Bot-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yoitsmeyusuf/Llama-3-Marksist-Bot-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yoitsmeyusuf/Llama-3-Marksist-Bot-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1
- SGLang
How to use yoitsmeyusuf/Llama-3-Marksist-Bot-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 "yoitsmeyusuf/Llama-3-Marksist-Bot-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yoitsmeyusuf/Llama-3-Marksist-Bot-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "yoitsmeyusuf/Llama-3-Marksist-Bot-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yoitsmeyusuf/Llama-3-Marksist-Bot-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yoitsmeyusuf/Llama-3-Marksist-Bot-v1 with Docker Model Runner:
docker model run hf.co/yoitsmeyusuf/Llama-3-Marksist-Bot-v1
Model Card for Llama-3-Marksist-Bot-v1
Llama-3-Marksist-Bot-v1 is a fine-tuned version of the Meta Llama 3 8B model, designed to analyze questions and generate responses through the theoretical framework of Dialectical and Historical Materialism. The model has been trained on a curated dataset of classical Marxist texts to simulate the reasoning style of a political theoretician.
Model Details
Model Description
This model explores the capability of Large Language Models (LLMs) to adopt specific philosophical and political personas. By using Low-Rank Adaptation (LoRA), the base Llama 3 model was fine-tuned on Turkish translations of key texts from Karl Marx, Friedrich Engels, and Vladimir Lenin (specifically focusing on The State and Revolution).
The goal is not to provide a general-purpose assistant, but to create a specialized tool for academic and theoretical inquiries that require a consistent materialist perspective.
- Developed by: [Senin Kullanıcı Adın / Topluluk]
- Model type: Causal Language Model (Fine-tuned with LoRA)
- Language(s) (NLP): Turkish (tr)
- License: Llama 3 Community License
- Finetuned from model:
meta-llama/Meta-Llama-3-8B
Model Sources
- Repository: [Hugging Face Repo Linkin]
- Training Method: QLoRA (Quantized Low-Rank Adaptation)
Uses
Direct Use
This model is intended for:
- Academic Research: Analyzing how LLMs interpret and regenerate complex political theory.
- Philosophical Inquiry: Generating responses to modern problems using 19th and 20th-century materialist frameworks.
- Educational Purposes: Understanding concepts like "Surplus Value," "Alienation," and "Class Struggle" in an interactive format.
Out-of-Scope Use
- This model should not be used as a general-purpose assistant for daily tasks.
- It is not designed to provide neutral or unbiased information; by definition, it is biased towards a specific political worldview.
- It should not be used to incite illegal acts or violence.
Bias, Risks, and Limitations
Theoretical Bias: This model is explicitly fine-tuned to adopt a Marxist-Leninist perspective. It will interpret economic and social issues through this specific lens, rejecting other economic theories (e.g., Neoclassical economics) as per its training data.
Hallucination: Like all LLMs, it may generate factually incorrect information while sounding confident.
Historical Context: The training data consists of historical texts. The model might apply historical contexts to modern situations in ways that may not be entirely accurate or relevant.
How to Get Started with the Model
You can use this model with the transformers library. Since it is a LoRA adapter, it needs to be loaded with the base model.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Base Model
base_model_name = "meta-llama/Meta-Llama-3-8B"
adapter_model_name = "yoitsmeyusuf/Llama-3-Marksist-Bot-v1" # Replace with your username
# Load Tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
# Load Base Model (Quantized for efficiency)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
load_in_4bit=True,
device_map="auto"
)
# Load Adapter
model = PeftModel.from_pretrained(base_model, adapter_model_name)
# Inference
prompt = "Sınıf bilinci nedir?"
messages = [
{"role": "system", "content": "Sen diyalektik materyalizm konusunda uzman bir teorisyensin."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
Training Data
The dataset consists of high-quality Turkish translations of classical texts, processed into a Question-Answer format to facilitate instruction following. Key sources include:
- The State and Revolution (Lenin)
- Selected works on Dialectical Materialism
Training Procedure
- Hardware: NVIDIA RTX 3090 (24GB VRAM)
- Framework: PyTorch, PEFT (LoRA), BitsAndBytes
- Quantization: 4-bit (NF4)
- Optimizer: Paged AdamW 32bit
Training Hyperparameters
- Epochs: 1
- Batch Size: 4 (with Gradient Accumulation)
- Learning Rate: 2e-4
- LoRA Rank: 64
- LoRA Alpha: 128
Environmental Impact
- Hardware Type: Consumer GPU (RTX 3090)
- Hours used: < 1 hour
- Carbon Emitted: Negligible (Low impact training via PEFT)
Model tree for yoitsmeyusuf/Llama-3-Marksist-Bot-v1
Base model
meta-llama/Meta-Llama-3-8B