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 Settings
- 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
Upload folder using huggingface_hub
Browse files- bdeq/README.md +46 -0
- bdeq/adapter_config.json +47 -0
- bdeq/adapter_model.safetensors +3 -0
bdeq/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: mistralai/Mistral-7B-Instruct-v0.3
|
| 3 |
+
library_name: peft
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- transformers
|
| 9 |
+
- mistral
|
| 10 |
+
- grpo
|
| 11 |
+
- molecule-optimization
|
| 12 |
+
- bdeq
|
| 13 |
+
license: mit
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# C-MORAL Mistral GRPO BDEQ Adapter
|
| 17 |
+
|
| 18 |
+
LoRA adapter for molecule optimization trained with GRPO on the `bdeq` task.
|
| 19 |
+
|
| 20 |
+
## Base Model
|
| 21 |
+
|
| 22 |
+
- `mistralai/Mistral-7B-Instruct-v0.3`
|
| 23 |
+
|
| 24 |
+
## Task
|
| 25 |
+
|
| 26 |
+
- task alias: `bdeq`
|
| 27 |
+
- property combination: `bbbp+drd2+herg+qed`
|
| 28 |
+
|
| 29 |
+
## Method
|
| 30 |
+
|
| 31 |
+
- algorithm: `GRPO`
|
| 32 |
+
- adapter type: `LoRA`
|
| 33 |
+
|
| 34 |
+
## Load With PEFT
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 38 |
+
from peft import PeftModel
|
| 39 |
+
|
| 40 |
+
base_model_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 41 |
+
adapter_id = "Rwigle/C-MORAL-Mistral-GRPO"
|
| 42 |
+
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
| 44 |
+
model = AutoModelForCausalLM.from_pretrained(base_model_id)
|
| 45 |
+
model = PeftModel.from_pretrained(model, adapter_id, subfolder="bdeq")
|
| 46 |
+
```
|
bdeq/adapter_config.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "mistralai/Mistral-7B-Instruct-v0.3",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 16,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.05,
|
| 22 |
+
"megatron_config": null,
|
| 23 |
+
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": null,
|
| 25 |
+
"peft_type": "LORA",
|
| 26 |
+
"peft_version": "0.18.0",
|
| 27 |
+
"qalora_group_size": 16,
|
| 28 |
+
"r": 16,
|
| 29 |
+
"rank_pattern": {},
|
| 30 |
+
"revision": null,
|
| 31 |
+
"target_modules": [
|
| 32 |
+
"gate_proj",
|
| 33 |
+
"o_proj",
|
| 34 |
+
"v_proj",
|
| 35 |
+
"down_proj",
|
| 36 |
+
"k_proj",
|
| 37 |
+
"q_proj",
|
| 38 |
+
"lm_head",
|
| 39 |
+
"up_proj"
|
| 40 |
+
],
|
| 41 |
+
"target_parameters": null,
|
| 42 |
+
"task_type": "CAUSAL_LM",
|
| 43 |
+
"trainable_token_indices": null,
|
| 44 |
+
"use_dora": false,
|
| 45 |
+
"use_qalora": false,
|
| 46 |
+
"use_rslora": false
|
| 47 |
+
}
|
bdeq/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e4144bc79ccb76fb1c7cf6eab5ae2cfe84bcb175e26cfa889ba7dd2499698a6
|
| 3 |
+
size 438627360
|