Unverified Commit a5e0defb authored by Xuehai Pan's avatar Xuehai Pan Committed by GitHub
Browse files

minor: Add basic editorconfig and pre-commit hooks to enforce style for whitespaces (#1926)

parent 96766101
...@@ -759,7 +759,7 @@ class Engine: ...@@ -759,7 +759,7 @@ class Engine:
# before python program terminates, call shutdown implicitly. Therefore, users don't have to explicitly call .shutdown() # before python program terminates, call shutdown implicitly. Therefore, users don't have to explicitly call .shutdown()
atexit.register(self.shutdown) atexit.register(self.shutdown)
# runtime server default log level is log # runtime server default log level is log
# offline engine works in scripts, so we set it to error # offline engine works in scripts, so we set it to error
......
This diff is collapsed.
...@@ -320,7 +320,7 @@ jinja_env = jinja2.Environment( ...@@ -320,7 +320,7 @@ jinja_env = jinja2.Environment(
_message_template = """ _message_template = """
<div class="message {{ role }}"> <div class="message {{ role }}">
<div class="role"> <div class="role">
{{ role }} {{ role }}
{% if variant %}<span class="variant">({{ variant }})</span>{% endif %} {% if variant %}<span class="variant">({{ variant }})</span>{% endif %}
</div> </div>
<div class="content"> <div class="content">
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
""" """
HumanEval: Evaluating Large Language Models Trained on Code HumanEval: Evaluating Large Language Models Trained on Code
Mark Chen and Jerry Tworek and Heewoo Jun and Qiming Yuan and Henrique Ponde de Oliveira Pinto and Jared Kaplan and Harri Edwards and Yuri Burda and Nicholas Joseph and Greg Brockman and Alex Ray and Raul Puri and Gretchen Krueger and Michael Petrov and Heidy Khlaaf and Girish Sastry and Pamela Mishkin and Brooke Chan and Scott Gray and Nick Ryder and Mikhail Pavlov and Alethea Power and Lukasz Kaiser and Mohammad Bavarian and Clemens Winter and Philippe Tillet and Felipe Petroski Such and Dave Cummings and Matthias Plappert and Fotios Chantzis and Elizabeth Barnes and Ariel Herbert-Voss and William Hebgen Guss and Alex Nichol and Alex Paino and Nikolas Tezak and Jie Tang and Igor Babuschkin and Suchir Balaji and Shantanu Jain and William Saunders and Christopher Hesse and Andrew N. Carr and Jan Leike and Josh Achiam and Vedant Misra and Evan Morikawa and Alec Radford and Matthew Knight and Miles Brundage and Mira Murati and Katie Mayer and Peter Welinder and Bob McGrew and Dario Amodei and Sam McCandlish and Ilya Sutskever and Wojciech Zaremba Mark Chen and Jerry Tworek and Heewoo Jun and Qiming Yuan and Henrique Ponde de Oliveira Pinto and Jared Kaplan and Harri Edwards and Yuri Burda and Nicholas Joseph and Greg Brockman and Alex Ray and Raul Puri and Gretchen Krueger and Michael Petrov and Heidy Khlaaf and Girish Sastry and Pamela Mishkin and Brooke Chan and Scott Gray and Nick Ryder and Mikhail Pavlov and Alethea Power and Lukasz Kaiser and Mohammad Bavarian and Clemens Winter and Philippe Tillet and Felipe Petroski Such and Dave Cummings and Matthias Plappert and Fotios Chantzis and Elizabeth Barnes and Ariel Herbert-Voss and William Hebgen Guss and Alex Nichol and Alex Paino and Nikolas Tezak and Jie Tang and Igor Babuschkin and Suchir Balaji and Shantanu Jain and William Saunders and Christopher Hesse and Andrew N. Carr and Jan Leike and Josh Achiam and Vedant Misra and Evan Morikawa and Alec Radford and Matthew Knight and Miles Brundage and Mira Murati and Katie Mayer and Peter Welinder and Bob McGrew and Dario Amodei and Sam McCandlish and Ilya Sutskever and Wojciech Zaremba
https://arxiv.org/abs/2107.03374 https://github.com/openai/human-eval/ https://arxiv.org/abs/2107.03374 https://github.com/openai/human-eval/
""" """
import random import random
......
# Adapted from https://github.com/openai/simple-evals/ # Adapted from https://github.com/openai/simple-evals/
""" """
MGSM: Multilingual Grade School Math Benchmark (MGSM) is a benchmark of grade-school math problems. MGSM: Multilingual Grade School Math Benchmark (MGSM) is a benchmark of grade-school math problems.
Language Models are Multilingual Chain-of-Thought Reasoners Language Models are Multilingual Chain-of-Thought Reasoners
Freda Shi, Mirac Suzgun, Markus Freitag, Xuezhi Wang, Suraj Srivats, Soroush Vosoughi, Hyung Won Chung, Yi Tay, Sebastian Ruder, Denny Zhou, Dipanjan Das, Jason Wei Freda Shi, Mirac Suzgun, Markus Freitag, Xuezhi Wang, Suraj Srivats, Soroush Vosoughi, Hyung Won Chung, Yi Tay, Sebastian Ruder, Denny Zhou, Dipanjan Das, Jason Wei
https://arxiv.org/abs/2210.03057 reference: https://github.com/google-research/url-nlp https://arxiv.org/abs/2210.03057 reference: https://github.com/google-research/url-nlp
""" """
import re import re
......
...@@ -22,4 +22,4 @@ rand = "0.8.5" ...@@ -22,4 +22,4 @@ rand = "0.8.5"
reqwest = { version = "0.12.8", features = ["stream"] } reqwest = { version = "0.12.8", features = ["stream"] }
futures-util = "0.3" futures-util = "0.3"
serde_json = "=1.0.1" serde_json = "=1.0.1"
pyo3 = { version = "0.22.5", features = ["extension-module"] } pyo3 = { version = "0.22.5", features = ["extension-module"] }
\ No newline at end of file
...@@ -36,7 +36,7 @@ Usage: router [OPTIONS] ...@@ -36,7 +36,7 @@ Usage: router [OPTIONS]
Options: Options:
--host <HOST> [default: 127.0.0.1] --host <HOST> [default: 127.0.0.1]
--port <PORT> [default: 3001] --port <PORT> [default: 3001]
--worker-urls <WORKER_URLS> --worker-urls <WORKER_URLS>
--policy <POLICY> [default: round_robin] [possible values: round_robin, random] --policy <POLICY> [default: round_robin] [possible values: round_robin, random]
-h, --help Print help -h, --help Print help
-V, --version Print version -V, --version Print version
...@@ -82,11 +82,11 @@ $ pip install <path to wheel> ...@@ -82,11 +82,11 @@ $ pip install <path to wheel>
1. Run test 1. Run test
``` ```
$ cargo test $ cargo test
``` ```
2. Run lint 2. Run lint
``` ```
$ cargo fmt $ cargo fmt
``` ```
\ No newline at end of file
...@@ -7,9 +7,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ...@@ -7,9 +7,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Follow the installation prompts, then reload your shell # Follow the installation prompts, then reload your shell
. "$HOME/.cargo/env" . "$HOME/.cargo/env"
source $HOME/.cargo/env source $HOME/.cargo/env
# Verify installation # Verify installation
rustc --version rustc --version
cargo --version cargo --version
\ No newline at end of file
...@@ -10,7 +10,7 @@ HF_TOKEN = "..." ...@@ -10,7 +10,7 @@ HF_TOKEN = "..."
prompt = """ prompt = """
### Instruction: ### Instruction:
Write a poem about the transformers Python library. Write a poem about the transformers Python library.
Mention the word "large language models" in that poem. Mention the word "large language models" in that poem.
### Response: ### Response:
The Transformers are large language models, The Transformers are large language models,
......
...@@ -5,7 +5,7 @@ MODEL = "mistralai/Mistral-7B-Instruct-v0.3" ...@@ -5,7 +5,7 @@ MODEL = "mistralai/Mistral-7B-Instruct-v0.3"
ADAPTER = "/home/ying/test_lora" ADAPTER = "/home/ying/test_lora"
prompt = """ prompt = """
### Instruction: ### Instruction:
Write a poem about the transformers Python library. Write a poem about the transformers Python library.
Mention the word "large language models" in that poem. Mention the word "large language models" in that poem.
### Response: ### Response:
The Transformers are large language models, The Transformers are large language models,
......
#!/bin/bash #!/bin/bash
# This script is used for release. # This script is used for release.
# It tags all remote branches starting with 'v' with the same name as the branch, # It tags all remote branches starting with 'v' with the same name as the branch,
# deletes the corresponding branches from the remote, and pushes the tags to the remote repository. # deletes the corresponding branches from the remote, and pushes the tags to the remote repository.
git fetch origin --prune git fetch origin --prune
...@@ -27,4 +27,3 @@ done ...@@ -27,4 +27,3 @@ done
git push --tags git push --tags
echo "All branches starting with 'v' have been tagged, deleted from remote, and pushed to the remote repository." echo "All branches starting with 'v' have been tagged, deleted from remote, and pushed to the remote repository."
# Run Unit Tests # Run Unit Tests
SGLang uses the built-in library [unittest](https://docs.python.org/3/library/unittest.html) as the testing framework. SGLang uses the built-in library [unittest](https://docs.python.org/3/library/unittest.html) as the testing framework.
## Test Backend Runtime ## Test Backend Runtime
```bash ```bash
......
This diff is collapsed.
File mode changed from 100755 to 100644
...@@ -45,7 +45,7 @@ TORCH_DTYPES = [torch.float16] ...@@ -45,7 +45,7 @@ TORCH_DTYPES = [torch.float16]
PROMPTS = [ PROMPTS = [
""" """
### Instruction: ### Instruction:
Write a poem about the transformers Python library. Write a poem about the transformers Python library.
Mention the word "large language models" in that poem. Mention the word "large language models" in that poem.
### Response: ### Response:
The Transformers are large language models, The Transformers are large language models,
......
...@@ -53,7 +53,7 @@ class TestDataParallelism(unittest.TestCase): ...@@ -53,7 +53,7 @@ class TestDataParallelism(unittest.TestCase):
# pause a few seconds then send again # pause a few seconds then send again
time.sleep(5) time.sleep(5)
response = requests.post( response = requests.post(
self.base_url + "/update_weights", self.base_url + "/update_weights",
json={"model_path": DEFAULT_MODEL_NAME_FOR_TEST}, json={"model_path": DEFAULT_MODEL_NAME_FOR_TEST},
......
...@@ -11,9 +11,9 @@ from sglang.test.test_utils import ( ...@@ -11,9 +11,9 @@ from sglang.test.test_utils import (
) )
MANY_NEW_TOKENS_PROMPT = """ MANY_NEW_TOKENS_PROMPT = """
Please write an extremely detailed and vivid fantasy story, set in a world full of intricate magic systems, political intrigue, and complex characters. Please write an extremely detailed and vivid fantasy story, set in a world full of intricate magic systems, political intrigue, and complex characters.
Ensure that you thoroughly describe every scene, character's motivations, and the environment. Include long, engaging dialogues and elaborate on the inner thoughts of the characters. Ensure that you thoroughly describe every scene, character's motivations, and the environment. Include long, engaging dialogues and elaborate on the inner thoughts of the characters.
Each section should be as comprehensive as possible to create a rich and immersive experience for the reader. Each section should be as comprehensive as possible to create a rich and immersive experience for the reader.
The story should span multiple events, challenges, and character developments over time. Aim to make the story at least 3,000 words long. The story should span multiple events, challenges, and character developments over time. Aim to make the story at least 3,000 words long.
""" """
...@@ -109,7 +109,7 @@ class TestMatchedStop(unittest.TestCase): ...@@ -109,7 +109,7 @@ class TestMatchedStop(unittest.TestCase):
llama_format_prompt = """ llama_format_prompt = """
<|begin_of_text|><|start_header_id|>system<|end_header_id|> <|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|> You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>
What is 2 + 2?<|eot_id|><|start_header_id|>assistant<|end_header_id|> What is 2 + 2?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
""" """
eos_token_id = 128009 eos_token_id = 128009
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment