Instructions to use Rwigle/C-MORAL-Mistral-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Rwigle/C-MORAL-Mistral-GRPO with PEFT:
Task type is invalid.
- Transformers
How to use Rwigle/C-MORAL-Mistral-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rwigle/C-MORAL-Mistral-GRPO")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Rwigle/C-MORAL-Mistral-GRPO", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Rwigle/C-MORAL-Mistral-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rwigle/C-MORAL-Mistral-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rwigle/C-MORAL-Mistral-GRPO", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Rwigle/C-MORAL-Mistral-GRPO
- SGLang
How to use Rwigle/C-MORAL-Mistral-GRPO 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 "Rwigle/C-MORAL-Mistral-GRPO" \ --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": "Rwigle/C-MORAL-Mistral-GRPO", "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 "Rwigle/C-MORAL-Mistral-GRPO" \ --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": "Rwigle/C-MORAL-Mistral-GRPO", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Rwigle/C-MORAL-Mistral-GRPO with Docker Model Runner:
docker model run hf.co/Rwigle/C-MORAL-Mistral-GRPO
C-MORAL Mistral GRPO Adapters
This repository contains LoRA adapters released for C-MORAL:
C-MORAL: Controllable Multi-Objective Molecular Optimization with Reinforcement Alignment for LLMs
These adapters are trained on top of:
mistralai/Mistral-7B-Instruct-v0.3
using:
GRPO
for controllable multi-objective molecular optimization.
Available Task Subfolders
Each task is stored as a separate subfolder in this Hugging Face repository.
abmp:amp+bbbp+mutag+plogpacep:amp+carc+herg+plogpbcmq:bbbp+carc+mutag+qedbdeq:bbbp+drd2+herg+qedbdpq:bbbp+drd2+qed+plogpbpq:bbbp+plogp+qedcde:carc+drd2+hergdhmq:drd2+hia+mutag+qedelq:herg+liv+qedhlmpq:hia+liv+mutag+plogp+qed
Usage
Load a task-specific adapter with PEFT by setting subfolder to the desired task name.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "mistralai/Mistral-7B-Instruct-v0.3"
adapter_repo = "Rwigle/C-MORAL-Mistral-GRPO"
task_subfolder = "bpq" # change to abmp / elq / hlmpq / ...
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id)
model = PeftModel.from_pretrained(model, adapter_repo, subfolder=task_subfolder)
Method
- Base model:
mistralai/Mistral-7B-Instruct-v0.3 - Adapter type:
LoRA - Training algorithm:
GRPO - Domain: multi-objective molecular optimization
Project
- GitHub:
https://github.com/Rwigie/C-MORAL
Citation
If you use these adapters, please cite:
C-MORAL: Controllable Multi-Objective Molecular Optimization with
Reinforcement Alignment for LLMs
- Downloads last month
- -
Model tree for Rwigle/C-MORAL-Mistral-GRPO
Base model
mistralai/Mistral-7B-v0.3 Finetuned
mistralai/Mistral-7B-Instruct-v0.3