Text Generation
Transformers
Safetensors
English
psychometrics
personality
mental-health
computational-psychology
adapter-tuning
Instructions to use huvucode/PsychAdapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huvucode/PsychAdapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huvucode/PsychAdapter")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("huvucode/PsychAdapter", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use huvucode/PsychAdapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huvucode/PsychAdapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huvucode/PsychAdapter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/huvucode/PsychAdapter
- SGLang
How to use huvucode/PsychAdapter 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 "huvucode/PsychAdapter" \ --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": "huvucode/PsychAdapter", "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 "huvucode/PsychAdapter" \ --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": "huvucode/PsychAdapter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use huvucode/PsychAdapter with Docker Model Runner:
docker model run hf.co/huvucode/PsychAdapter
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,8 +9,6 @@ tags:
|
|
| 9 |
- psychometrics
|
| 10 |
- personality
|
| 11 |
- mental-health
|
| 12 |
-
- big-five
|
| 13 |
-
- depression
|
| 14 |
- computational-psychology
|
| 15 |
- adapter-tuning
|
| 16 |
library_name: transformers
|
|
@@ -24,12 +22,22 @@ PsychAdapter is a modular framework designed to adapt Large Language Models (LLM
|
|
| 24 |
## Model Details
|
| 25 |
|
| 26 |
- **Developed by:** Huy Vu, et al.
|
| 27 |
-
- **Published in:**
|
| 28 |
-
- **Model Type:** Adapter-based LLM (optimized for Llama
|
| 29 |
- **Language(s):** English
|
| 30 |
- **License:** OpenRAIL
|
| 31 |
-
- **Repository:**
|
| 32 |
-
- **Paper:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## Intended Use
|
| 35 |
|
|
@@ -43,31 +51,23 @@ This tool is for research purposes and should not be used for clinical diagnosis
|
|
| 43 |
|
| 44 |
## Training & Dataset
|
| 45 |
|
| 46 |
-
The model is trained
|
| 47 |
-
|
| 48 |
-
* **Big Five Personality Traits:** Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism (OCEAN).
|
| 49 |
-
* **Mental Health Scores:** Quantitative markers for **Depression** and **Life Satisfaction**.
|
| 50 |
-
|
| 51 |
-
These traits are used to steer the generative process, allowing the model to reflect specific psychological phenotypes in text generation.
|
| 52 |
-
|
| 53 |
-
## Training Procedure
|
| 54 |
-
|
| 55 |
-
The framework utilizes parameter-efficient fine-tuning (PEFT) to integrate psychological trait embeddings within the Transformer layers.
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
|
|
|
| 59 |
|
| 60 |
## Citation
|
| 61 |
|
| 62 |
-
If you use these checkpoints or the dataset in your research, please cite:
|
| 63 |
|
| 64 |
```bibtex
|
| 65 |
@article{vu2026psychadapter,
|
| 66 |
title={PsychAdapter: Adapting LLM Transformers to Reflect Traits, Personality and Mental Health},
|
| 67 |
author={Vu, Huy and Nguyen, Huy Anh and Ganesan, Adithya V. and Juhng, Swanie and Kjell, Oscar N. E. and Sedoc, Joao and Kern, Margaret L. and Boyd, Ryan L. and Ungar, Lyle and Schwartz, H. Andrew and Eichstaedt, Johannes C.},
|
| 68 |
journal={npj Artificial Intelligence},
|
| 69 |
-
volume={
|
| 70 |
-
number={
|
| 71 |
year={2026},
|
| 72 |
publisher={Nature Publishing Group},
|
| 73 |
doi={10.1038/s44387-026-00071-9}
|
|
|
|
| 9 |
- psychometrics
|
| 10 |
- personality
|
| 11 |
- mental-health
|
|
|
|
|
|
|
| 12 |
- computational-psychology
|
| 13 |
- adapter-tuning
|
| 14 |
library_name: transformers
|
|
|
|
| 22 |
## Model Details
|
| 23 |
|
| 24 |
- **Developed by:** Huy Vu, et al.
|
| 25 |
+
- **Published in:** npj Artificial Intelligence (Nature Portfolio)
|
| 26 |
+
- **Model Type:** Adapter-based LLM (optimized for Llama and Gemma architectures)
|
| 27 |
- **Language(s):** English
|
| 28 |
- **License:** OpenRAIL
|
| 29 |
+
- **Repository:** https://github.com/humanlab/psychadapter
|
| 30 |
+
- **Paper:** https://www.nature.com/articles/s44387-026-00071-9
|
| 31 |
+
|
| 32 |
+
## Checkpoint Structure
|
| 33 |
+
|
| 34 |
+
The provided checkpoints include the following components:
|
| 35 |
+
|
| 36 |
+
1. **Base Models:** The foundational pre-trained LLM weights (e.g., Gemma-2b) used as the backbone for adaptation.
|
| 37 |
+
2. **LoRA Weights (Big 5):** Specialized Low-Rank Adaptation (LoRA) weights trained specifically on the Big Five personality traits (Openness, Conscientiousness, Extraversion, Agreeableness, Neuroticism).
|
| 38 |
+
3. **LoRA Weights (Mental Health):** Specialized LoRA weights trained to reflect mental health variables, specifically Depression and Satisfaction with Life (SWL).
|
| 39 |
+
|
| 40 |
+
These adapters are designed to be swapped or combined to steer the base model's output according to the desired psychological profile.
|
| 41 |
|
| 42 |
## Intended Use
|
| 43 |
|
|
|
|
| 51 |
|
| 52 |
## Training & Dataset
|
| 53 |
|
| 54 |
+
The model is trained on the PsychAdapter dataset (available at huvucode/PsychAdapter), which consists of curated training and validation splits in .csv format designed to capture nuanced psychological markers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
### Training Infrastructure
|
| 57 |
+
- **Frameworks:** PyTorch, HuggingFace Transformers, PEFT.
|
| 58 |
+
- **Optimization:** High-performance GPU kernels and low-precision training for efficient adapter integration.
|
| 59 |
|
| 60 |
## Citation
|
| 61 |
|
| 62 |
+
If you use these checkpoints or the dataset in your research, please cite the original journal publication:
|
| 63 |
|
| 64 |
```bibtex
|
| 65 |
@article{vu2026psychadapter,
|
| 66 |
title={PsychAdapter: Adapting LLM Transformers to Reflect Traits, Personality and Mental Health},
|
| 67 |
author={Vu, Huy and Nguyen, Huy Anh and Ganesan, Adithya V. and Juhng, Swanie and Kjell, Oscar N. E. and Sedoc, Joao and Kern, Margaret L. and Boyd, Ryan L. and Ungar, Lyle and Schwartz, H. Andrew and Eichstaedt, Johannes C.},
|
| 68 |
journal={npj Artificial Intelligence},
|
| 69 |
+
volume={2},
|
| 70 |
+
number={7},
|
| 71 |
year={2026},
|
| 72 |
publisher={Nature Publishing Group},
|
| 73 |
doi={10.1038/s44387-026-00071-9}
|