Views
No views yet
mistralai/Mistral-7B-Instruct-v0.3comrade-ai-2 is a LoRA adapter for Mistral 7B Instruct, fine-tuned to answer
questions from a Marxist–Leninist anti-revisionist perspective.dataset.jsonl with ~500 manually written instruction–response pairs,
covering:1{"instruction": "...", "input": "", "output": "..."}```
2
3
4## How To Use
5
6```from transformers import AutoModelForCausalLM, AutoTokenizer
7from peft import PeftModel
8
9base_model = "mistralai/Mistral-7B-Instruct-v0.3"
10adapter_id = "LezleeFirestone/comrade-ai-2"
11
12tokenizer = AutoTokenizer.from_pretrained(base_model)
13model = AutoModelForCausalLM.from_pretrained(
14 base_model,
15 device_map="auto",
16 torch_dtype="auto"
17)
18
19model = PeftModel.from_pretrained(model, adapter_id)
20
21prompt = "Explain the difference between social democracy and Marxism–Leninism."
22inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
23outputs = model.generate(**inputs, max_new_tokens=512)
24print(tokenizer.decode(outputs[0], skip_special_tokens=True))```
25
26
27
28## How To Use With Ollama
29
30Create a ModelFile-
31Open a file in notepad++ and save as ModelFile (no extension)
32ollama run comrade-ai-2