Update README.md

This commit is contained in:
Taeyoung Lee
2024-08-04 03:17:31 +00:00
committed by system
parent 5f061ea87f
commit 05774d31bb

View File

@@ -49,7 +49,21 @@ print(outputs[0]["generated_text"])
## 💻 Usage for VLLM ## 💻 Usage for VLLM
Use with transformers
Starting with ```vllm``` onward, you can run conversational inference using the vLLM pipeline abstraction with the gen() function.
Make sure to update your vllm installation via ```pip install --upgrade vllm.```
```python ```python
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer, pipeline
BASE_MODEL = "sh2orc/Llama-3.1-Korean-8B-Instruct"
llm = LLM(model=BASE_MODEL)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = 'right'
def gen(instruction): def gen(instruction):
messages = [ messages = [