Fix tokenizer for vllm worker
diff --git a/fastchat/serve/vllm_worker.py b/fastchat/serve/vllm_worker.py
index 9da06bfdc2..0af680bb5f 100644
--- a/fastchat/serve/vllm_worker.py
+++ b/fastchat/serve/vllm_worker.py
@@ -55,6 +55,10 @@ def __init__(
             f"Loading the model {self.model_names} on worker {worker_id}, worker type: vLLM worker..."
         )
         self.tokenizer = llm_engine.engine.tokenizer
+        # This is to support vllm >= 0.2.7 where TokenizerGroup was introduced
+        # and llm_engine.engine.tokenizer was no longer a raw tokenizer
+        if hasattr(self.tokenizer, "tokenizer"):
+            self.tokenizer = llm_engine.engine.tokenizer.tokenizer
         self.context_len = get_context_length(llm_engine.engine.model_config.hf_config)
 
         if not no_register:

<!-- Thank you for your contribution! -->


<!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. -->

## Why are these changes needed?
A recent change to vLLM has changed the tokenizer structure by having an additional `TokenizerGroup` wrapping the `tokenizer` causing error when the `tokenizer.eos_token` is called in fastchat code.
<!-- Please give a short summary of the change and the problem this solves. -->

## Related issue number (if applicable)
Fixes #2978

<!-- For example: "Closes #1234" -->

## Checks

- [ ] I've run `format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed.
- [ ] I've made sure the relevant tests are passing (if applicable).
