Instructions to use alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2") model = AutoModelForCausalLM.from_pretrained("alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2
- SGLang
How to use alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2 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 "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2" \ --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": "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2", "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 "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2" \ --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": "alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2 with Docker Model Runner:
docker model run hf.co/alibaba-pai/pai-bloom-1b1-text2prompt-sd-v2
Update README.md
Browse files
README.md
CHANGED
|
@@ -77,3 +77,23 @@ table th:nth-of-type(2) {
|
|
| 77 |
|
| 78 |
If you want to use this model, please read this [document](https://terms.alicdn.com/legal-agreement/terms/common_platform_service/20230505180457947/20230505180457947.html) carefully and abide by the terms.
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
If you want to use this model, please read this [document](https://terms.alicdn.com/legal-agreement/terms/common_platform_service/20230505180457947/20230505180457947.html) carefully and abide by the terms.
|
| 79 |
|
| 80 |
+
|
| 81 |
+
## Paper Citation
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
If you find the model useful, please consider cite the paper:
|
| 85 |
+
|
| 86 |
+
```
|
| 87 |
+
@inproceedings{emnlp2023a,
|
| 88 |
+
author = {Tingfeng Cao and
|
| 89 |
+
Chengyu Wang and
|
| 90 |
+
Bingyan Liu and
|
| 91 |
+
Ziheng Wu and
|
| 92 |
+
Jinhui Zhu and
|
| 93 |
+
Jun Huang},
|
| 94 |
+
title = {BeautifulPrompt: Towards Automatic Prompt Engineering for Text-to-Image Synthesis},
|
| 95 |
+
booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track},
|
| 96 |
+
pages = {1--11},
|
| 97 |
+
year = {2023}
|
| 98 |
+
}
|
| 99 |
+
```
|