File size: 5,196 Bytes
7a01112
 
 
 
 
 
 
 
 
 
e798126
 
7a01112
 
 
 
172633c
b8a7da8
 
f6acaa7
b8a7da8
5578e32
f6acaa7
b8a7da8
5578e32
b8a7da8
 
172633c
 
844b93e
 
 
 
 
 
 
 
 
 
7a01112
 
 
 
 
 
 
 
844b93e
 
 
 
 
7a01112
844b93e
7a01112
844b93e
7a01112
844b93e
7a01112
 
 
 
 
 
 
 
 
 
 
 
232a7b4
7a01112
172633c
7a01112
 
 
 
172633c
 
 
be9a65e
7a01112
172633c
7a01112
b8a7da8
7a01112
 
 
 
 
 
 
8852285
7a01112
 
be9a65e
7a01112
 
8852285
7a01112
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# LLM Riddles

<div align="center">
	<br>
	<a href="https://github.com/opendilab/LLMRiddles/blob/main/llmriddles/assets/banner.svg">
		<img src="https://github.com/opendilab/LLMRiddles/blob/main/llmriddles/assets/banner.svg" width="1000" height="200" alt="Click to see the source">
	</a>
	<br>
</div>

[English](https://github.com/opendilab/LLMRiddles/blob/main/README.md) | 简体中文

## :thinking: 什么是LLM Riddles
欢迎来到 LLM Riddles!这是一个与语言模型斗智斗勇的游戏。在游戏中,你需要构造与语言模型交互的问题,来得到符合要求的答案。在这个过程中,你可以开动脑筋,用你想到的所有方式,让模型输出答案要求的结果。

## :space_invader: 如何试玩
我们提供了在线版本以供玩家直接访问试玩:
- [Hugging Face][ChatGPT + 英文(需配置api key)](https://huggingface.co/spaces/OpenDILabCommunity/LLMRiddlesChatGPTEN)
- [Hugging Face][ChatGPT + 中文(需配置api key)](https://huggingface.co/spaces/OpenDILabCommunity/LLMRiddlesChatGPTCN)
- [Hugging Face][ChatGLM + 英文(已预设api key)](https://huggingface.co/spaces/OpenDILabCommunity/LLMRiddlesChatGLMEN)
- [Hugging Face][ChatGLM + 中文(已预设api key)](https://huggingface.co/spaces/OpenDILabCommunity/LLMRiddlesChatGLMCN)
- [OpenXLab][ChatGPT + 中文(需配置api key)](https://openxlab.org.cn/apps/detail/OpenDILab/LLMRiddlesChatGPTCN)
- [OpenXLab][ChatGPT + 英文(需配置api key)](https://openxlab.org.cn/apps/detail/OpenDILab/LLMRiddlesChatGPTEN)
- [OpenXLab][ChatGLM + 中文(已预设api key)](https://openxlab.org.cn/apps/detail/OpenDILab/LLMRiddlesChatGLMCN)
- [OpenXLab][ChatGLM + 英文(已预设api key)](https://openxlab.org.cn/apps/detail/OpenDILab/LLMRiddlesChatGLMEN)
- [Private Server][Mistral + 英文(已预设api key)](https://d9b451a97791dd8ef3.gradio.live)
- [Private Server][ChatGPT + 中文(已预设api key)](http://llmriddles.opendilab.net/)

本地部署可以通过以下方式:
## 安装
### ChatGPT 或 ChatGLM API
```shell
pip3 install -r requirements.txt
```
### Mistral-7B-Instruct-v0.1 本地推理
```shell
pip3 install -r requirements-dev.txt
```
## 启动
### ChatGPT + 中文
```shell
QUESTION_LANG=cn QUESTION_LLM='chatgpt' QUESTION_LLM_KEY=<your API key> python3 -u app.py
```
### ChatGPT + 英文
```shell
QUESTION_LANG=en QUESTION_LLM='chatgpt' QUESTION_LLM_KEY=<your API key> python3 -u app.py
```
### ChatGLM + 中文
```shell
QUESTION_LANG=cn QUESTION_LLM='chatglm' QUESTION_LLM_KEY=<your API key> python3 -u app.py
```
### ChatGLM + 英文
```shell
QUESTION_LANG=en QUESTION_LLM='chatglm' QUESTION_LLM_KEY=<your API key> python3 -u app.py
```
### Mistral-7B-Instruct-v0.1 + 英文
```shell
QUESTION_LANG=en QUESTION_LLM='mistral-7b' python3 -u app.py
```
## :technologist: 为什么制作这个游戏

我们的目标是通过这一游戏,让参与者深入领略到提示工程(prompt engineering)和自然语言处理的令人着迷之处。这个过程将向玩家们展示,如何巧妙地构建提示词(prompts),以及如何运用它们来引发人工智能系统的惊人反应,同时也帮助他们更好地理解深度学习和自然语言处理技术的不可思议之处。

## :raising_hand: 如何提交设计好的关卡
如果有好玩的问题或想法,欢迎玩家提交自己的创意,可以
[发起 Pull Request](https://github.com/opendilab/LLMRiddles/compare) 向我们提交, 我们会在审核通过后收录至关卡中。
问题的设计格式应包含以下几点:
- Pull Request标题,示例:feature(username): 章节X-关卡设计
- 希望被提及的ID
- 对应章节问题文件的修改
- \__init__.py的修改

完整示例请参考:[提交属于自己的关卡设计](https://github.com/opendilab/LLMRiddles/pull/6)

## :writing_hand: 未来计划

- [x] 支持自定义关卡
- [x] 在线试玩链接
- [x] Hugging Face Space 链接
- [x] 支持Mistral-7B(英文)
- [x] 支持ChatGLM(中文和英文)
- [ ] 支持Baichuan2-7B(中文)
- [ ] 支持LLaMA2-7B(英文)
- [ ] LLM 推理速度优化
- [ ] 更多题目和题解

## :speech_balloon: 反馈问题 & 提出建议
- 在 GitHub 上[发起 Issue](https://github.com/opendilab/CodeMorpheus/issues/new/choose)
- 通过邮件与我们联系 (opendilab@pjlab.org.cn)
- 在OpenDILab的群组中加入讨论(通过 WeChat: ding314assist 添加小助手微信)
<img src=https://github.com/opendilab/LLMRiddles/blob/main/llmriddles/assets/wechat.jpeg width=35% />

## :star2: Special Thanks
- 感谢 [Haoqiang Fan](https://www.zhihu.com/people/haoqiang-fan) 的原始创意和题目,为本项目的开发和扩展提供了灵感与动力。
- 感谢 [HuggingFace](https://huggingface.co) 对游戏的支持与协助。
- 感谢 [ChatGLM](https://chatglm.cn/) 对游戏的支持与协助,特别是供在线预览版使用的足量 tokens。
- 感谢 [LLM Riddles contributors](https://github.com/opendilab/LLMRiddles/graphs/contributors) 的实现与支持。

## :label: License
All code within this repository is under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

<p align="right">(<a href="#top">back to top</a>)</p>