Text Generation
Transformers
Safetensors
t5
text2text-generation
icd
historical-demography
digital-humanities
multi-label
text-generation-inference
Instructions to use codllm/codllm-base-deploy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codllm/codllm-base-deploy with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codllm/codllm-base-deploy")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("codllm/codllm-base-deploy") model = AutoModelForSeq2SeqLM.from_pretrained("codllm/codllm-base-deploy", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codllm/codllm-base-deploy with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codllm/codllm-base-deploy" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codllm/codllm-base-deploy", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codllm/codllm-base-deploy
- SGLang
How to use codllm/codllm-base-deploy 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 "codllm/codllm-base-deploy" \ --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": "codllm/codllm-base-deploy", "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 "codllm/codllm-base-deploy" \ --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": "codllm/codllm-base-deploy", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codllm/codllm-base-deploy with Docker Model Runner:
docker model run hf.co/codllm/codllm-base-deploy
Update public access instructions and add COD widget examples
Browse files
README.md
CHANGED
|
@@ -3,6 +3,11 @@ license: apache-2.0
|
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
base_model: google/flan-t5-base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
- nl
|
|
@@ -41,8 +46,6 @@ Install the inference dependencies; Transformers 5.1.0 is the version recorded w
|
|
| 41 |
uv add "transformers==5.1.0" torch sentencepiece
|
| 42 |
```
|
| 43 |
|
| 44 |
-
The repository is currently private. An account with access must first authenticate with `hf auth login`.
|
| 45 |
-
|
| 46 |
```python
|
| 47 |
import torch
|
| 48 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
base_model: google/flan-t5-base
|
| 6 |
+
widget:
|
| 7 |
+
- text: "cod: fever | age: unknown | sex: unknown"
|
| 8 |
+
example_title: "Cause text with missing metadata"
|
| 9 |
+
- text: "cod: pneumonia | age: 65 | sex: female"
|
| 10 |
+
example_title: "Cause text with age and sex"
|
| 11 |
language:
|
| 12 |
- en
|
| 13 |
- nl
|
|
|
|
| 46 |
uv add "transformers==5.1.0" torch sentencepiece
|
| 47 |
```
|
| 48 |
|
|
|
|
|
|
|
| 49 |
```python
|
| 50 |
import torch
|
| 51 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|