Instructions to use gokaygokay/Flux-Prompt-Enhance with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gokaygokay/Flux-Prompt-Enhance with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gokaygokay/Flux-Prompt-Enhance")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("gokaygokay/Flux-Prompt-Enhance") model = AutoModelForSeq2SeqLM.from_pretrained("gokaygokay/Flux-Prompt-Enhance", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gokaygokay/Flux-Prompt-Enhance with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gokaygokay/Flux-Prompt-Enhance" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gokaygokay/Flux-Prompt-Enhance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gokaygokay/Flux-Prompt-Enhance
- SGLang
How to use gokaygokay/Flux-Prompt-Enhance 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 "gokaygokay/Flux-Prompt-Enhance" \ --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": "gokaygokay/Flux-Prompt-Enhance", "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 "gokaygokay/Flux-Prompt-Enhance" \ --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": "gokaygokay/Flux-Prompt-Enhance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gokaygokay/Flux-Prompt-Enhance with Docker Model Runner:
docker model run hf.co/gokaygokay/Flux-Prompt-Enhance
Can you share some experience about how to train a model like this,thanks!
Can you share some experience about how to train a model like this,thanks!
Sure, you can look at this notebook, it is a simple seq2seq model fine tuning.
https://colab.research.google.com/drive/13qTF7Z_Lf-FO-7_j49NTUQWffi7m0_8K?usp=sharing
Whether to train with flux?
Sure, you can look at this notebook, it is a simple seq2seq model fine tuning.
https://colab.research.google.com/drive/13qTF7Z_Lf-FO-7_j49NTUQWffi7m0_8K?usp=sharing
step 5 of this script is brroken ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipython-input-4-1280422743.py in <cell line: 0>()
3 epochs = 5
4 model_name = f"{model_checkpoint}-prompt-enhancer"
----> 5 args = Seq2SeqTrainingArguments(
6 model_name,
7 evaluation_strategy="epoch",
TypeError: Seq2SeqTrainingArguments.init() got an unexpected keyword argument 'evaluation_strategy'
Probably needs old version of transformers
pip install transformers[torch] makes it run