Instructions to use klyang/MentaLLaMA-chat-13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use klyang/MentaLLaMA-chat-13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="klyang/MentaLLaMA-chat-13B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("klyang/MentaLLaMA-chat-13B") model = AutoModelForCausalLM.from_pretrained("klyang/MentaLLaMA-chat-13B", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use klyang/MentaLLaMA-chat-13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "klyang/MentaLLaMA-chat-13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "klyang/MentaLLaMA-chat-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/klyang/MentaLLaMA-chat-13B
- SGLang
How to use klyang/MentaLLaMA-chat-13B 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 "klyang/MentaLLaMA-chat-13B" \ --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": "klyang/MentaLLaMA-chat-13B", "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 "klyang/MentaLLaMA-chat-13B" \ --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": "klyang/MentaLLaMA-chat-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use klyang/MentaLLaMA-chat-13B with Docker Model Runner:
docker model run hf.co/klyang/MentaLLaMA-chat-13B
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ tags:
|
|
| 8 |
- medical
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
MentaLLaMA-chat-13B is part of the [MentaLLaMA](https://github.com/SteveKGYang/MentalLLaMA) project, the first open-source large language model (LLM) series for
|
| 14 |
interpretable mental health analysis with instruction-following capability. This model is finetuned based on the Meta LLaMA2-chat-13B foundation model and the full IMHI instruction tuning data.
|
|
@@ -17,6 +17,18 @@ It is fine-tuned on the IMHI dataset with 75K high-quality natural language inst
|
|
| 17 |
We perform a comprehensive evaluation on the IMHI benchmark with 20K test samples. The result shows that MentalLLaMA approaches state-of-the-art discriminative
|
| 18 |
methods in correctness and generates high-quality explanations.
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
## Other Models in MentaLLaMA
|
| 21 |
|
| 22 |
In addition to MentaLLaMA-chat-13B, the MentaLLaMA project includes another model: MentaLLaMA-chat-7B, MentalBART, MentalT5.
|
|
|
|
| 8 |
- medical
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Introduction
|
| 12 |
|
| 13 |
MentaLLaMA-chat-13B is part of the [MentaLLaMA](https://github.com/SteveKGYang/MentalLLaMA) project, the first open-source large language model (LLM) series for
|
| 14 |
interpretable mental health analysis with instruction-following capability. This model is finetuned based on the Meta LLaMA2-chat-13B foundation model and the full IMHI instruction tuning data.
|
|
|
|
| 17 |
We perform a comprehensive evaluation on the IMHI benchmark with 20K test samples. The result shows that MentalLLaMA approaches state-of-the-art discriminative
|
| 18 |
methods in correctness and generates high-quality explanations.
|
| 19 |
|
| 20 |
+
# Ethical Consideration
|
| 21 |
+
|
| 22 |
+
Although experiments on MentaLLaMA show promising performance on interpretable mental health analysis, we stress that
|
| 23 |
+
all predicted results and generated explanations should only used
|
| 24 |
+
for non-clinical research, and the help-seeker should get assistance
|
| 25 |
+
from professional psychiatrists or clinical practitioners. In addition,
|
| 26 |
+
recent studies have indicated LLMs may introduce some potential
|
| 27 |
+
bias, such as gender gaps. Meanwhile, some incorrect prediction results, inappropriate explanations, and over-generalization
|
| 28 |
+
also illustrate the potential risks of current LLMs. Therefore, there
|
| 29 |
+
are still many challenges in applying the model to real-scenario
|
| 30 |
+
mental health monitoring systems.
|
| 31 |
+
|
| 32 |
## Other Models in MentaLLaMA
|
| 33 |
|
| 34 |
In addition to MentaLLaMA-chat-13B, the MentaLLaMA project includes another model: MentaLLaMA-chat-7B, MentalBART, MentalT5.
|