Spaces:
Running
Running
add deepseek
Browse files- chat_template_app.py +11 -0
- client.py +14 -0
- consistency_app.py +9 -0
- setup.md +5 -0
- utils/voting_util.py +15 -0
chat_template_app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
|
3 |
+
## chat template
|
4 |
+
|
5 |
+
- special_tokens
|
6 |
+
- default_system
|
7 |
+
- tools
|
8 |
+
- tool_call
|
9 |
+
|
10 |
+
|
11 |
+
"""
|
client.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from gradio_client import Client
|
2 |
+
|
3 |
+
|
4 |
+
def self_chat_demo(system_message, num_turn=4):
|
5 |
+
client = Client("xu-song/tokenizer-arena")
|
6 |
+
result = client.predict(
|
7 |
+
text="Hello!!",
|
8 |
+
tokenizer_name="01-ai/Yi-1.5-34B",
|
9 |
+
api_name="/tokenize"
|
10 |
+
)
|
11 |
+
print(result)
|
12 |
+
|
13 |
+
if __name__ == "__main__":
|
14 |
+
self_chat_demo(system_message="你是一个小说家,擅长写武侠小说")
|
consistency_app.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
On the consistency of LLM tokenizer.
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
"""
|
8 |
+
|
9 |
+
|
setup.md
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
```sh
|
4 |
+
python compression_util.py
|
5 |
+
```
|
utils/voting_util.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard/blob/main/src/voting/vote_system.py
|
3 |
+
|
4 |
+
|
5 |
+
## 原理
|
6 |
+
|
7 |
+
https://huggingface.co/docs/huggingface_hub/guides/upload
|
8 |
+
|
9 |
+
## TODO
|
10 |
+
投票需要增加哪些 tokenizer。
|
11 |
+
"""
|
12 |
+
|
13 |
+
|
14 |
+
class VoteManager:
|
15 |
+
pass
|