Count the tokens/second when using --debug 
diff --git a/fastchat/serve/inference.py b/fastchat/serve/inference.py
index 489b379384..8c4572664a 100644
--- a/fastchat/serve/inference.py
+++ b/fastchat/serve/inference.py
@@ -4,6 +4,7 @@
 import math
 from typing import Iterable, Optional
 import sys
+import time
 import warnings
 
 import psutil
@@ -307,8 +308,12 @@ def chat_loop(
 
         chatio.prompt_for_output(conv.roles[1])
         output_stream = generate_stream_func(model, tokenizer, gen_params, device)
+        t = time.time()
         outputs = chatio.stream_output(output_stream)
+        t = time.time() - t
         conv.update_last_message(outputs.strip())
 
         if debug:
             print("\n", {"prompt": prompt, "outputs": outputs}, "\n")
+            num_tokens = len(tokenizer.encode(outputs))
+            print(f"Tokens per second: {num_tokens / t:.2f}\n")

## Why are these changes needed?
We would like to count the tokens/second when debugging a served model on the cli.
Result using `llama-7b`:
<img width="1360" alt="image" src="https://github.com/lm-sys/FastChat/assets/49086305/65021ce9-75e7-43f3-b716-1e84ce46c075">


## Related issue number (if applicable)
Closes #1268 

## Checks

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