Instructions to use andrewbrown/gpt2-mi-reflector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use andrewbrown/gpt2-mi-reflector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="andrewbrown/gpt2-mi-reflector")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("andrewbrown/gpt2-mi-reflector") model = AutoModelForCausalLM.from_pretrained("andrewbrown/gpt2-mi-reflector") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use andrewbrown/gpt2-mi-reflector with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "andrewbrown/gpt2-mi-reflector" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andrewbrown/gpt2-mi-reflector", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/andrewbrown/gpt2-mi-reflector
- SGLang
How to use andrewbrown/gpt2-mi-reflector 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 "andrewbrown/gpt2-mi-reflector" \ --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": "andrewbrown/gpt2-mi-reflector", "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 "andrewbrown/gpt2-mi-reflector" \ --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": "andrewbrown/gpt2-mi-reflector", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use andrewbrown/gpt2-mi-reflector with Docker Model Runner:
docker model run hf.co/andrewbrown/gpt2-mi-reflector
GPT2-MI-Reflector
A gpt2 based motivational interviewing reflector
Given a prompt and a response, this GPT2 based transformer will generate a reflection. It was fine-tuned on prompt/response/reflection triplets so it should also be inferenced with the same input style. Examples are shown below.
The triplets this reflector was fine-tuned on focus on smoking-cessation. Given this, its best performance is when inferencing about smoking.
To properly inference model (as it was fine-tuned), use the following format:
Prompt: ...Question from bot...
Response: ...Response from user...
Example Prompt: paste two lines below and generate a reflection
Prompt: What do you want to change in your smoking?
Response: I want to smoke less often in my life, its become quite stressful for me.
Model should generate a motivational interviewing adherent statement
- Downloads last month
- 6