Text Generation
Transformers
PyTorch
TensorFlow
JAX
TensorBoard
Safetensors
English
t5
text2text-generation
seq2seq
recipe-generation
text-generation-inference
Instructions to use flax-community/t5-recipe-generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flax-community/t5-recipe-generation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flax-community/t5-recipe-generation")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("flax-community/t5-recipe-generation") model = AutoModelForSeq2SeqLM.from_pretrained("flax-community/t5-recipe-generation", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flax-community/t5-recipe-generation with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flax-community/t5-recipe-generation" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flax-community/t5-recipe-generation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/flax-community/t5-recipe-generation
- SGLang
How to use flax-community/t5-recipe-generation 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 "flax-community/t5-recipe-generation" \ --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": "flax-community/t5-recipe-generation", "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 "flax-community/t5-recipe-generation" \ --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": "flax-community/t5-recipe-generation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use flax-community/t5-recipe-generation with Docker Model Runner:
docker model run hf.co/flax-community/t5-recipe-generation
Update config and add torch model
Browse files- config.json +8 -0
- pytorch_model.bin +3 -0
config.json
CHANGED
|
@@ -48,6 +48,14 @@
|
|
| 48 |
"max_length": 300,
|
| 49 |
"num_beams": 4,
|
| 50 |
"prefix": "translate English to Romanian: "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
}
|
| 52 |
},
|
| 53 |
"transformers_version": "4.9.0.dev0",
|
|
|
|
| 48 |
"max_length": 300,
|
| 49 |
"num_beams": 4,
|
| 50 |
"prefix": "translate English to Romanian: "
|
| 51 |
+
},
|
| 52 |
+
"text2text-generation": {
|
| 53 |
+
"early_stopping": true,
|
| 54 |
+
"max_length": 1024,
|
| 55 |
+
"repetition_penalty": 1.0,
|
| 56 |
+
"length_penalty": 1.0,
|
| 57 |
+
"num_beams": 5,
|
| 58 |
+
"prefix": "items: "
|
| 59 |
}
|
| 60 |
},
|
| 61 |
"transformers_version": "4.9.0.dev0",
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:637cc03a65c7ab9b1798e0ea03e6cd3909e278b1e441b2bc85a6eb3380607919
|
| 3 |
+
size 891727295
|