Spaces:
Running
Running
shaocongma
commited on
Commit
•
5df90ab
1
Parent(s):
765f23b
update annoncements
Browse files
app.py
CHANGED
@@ -40,6 +40,7 @@ else:
|
|
40 |
IS_OPENAI_API_KEY_AVAILABLE = False
|
41 |
|
42 |
DEFAULT_MODEL = "gpt-4" if IS_OPENAI_API_KEY_AVAILABLE else "gpt-3.5-turbo"
|
|
|
43 |
DEFAULT_SECTIONS = ["introduction", "related works", "backgrounds", "methodology", "experiments",
|
44 |
"conclusion", "abstract"] if IS_OPENAI_API_KEY_AVAILABLE \
|
45 |
else ["introduction", "related works"]
|
@@ -60,16 +61,19 @@ theme = gr.themes.Default(font=gr.themes.GoogleFont("Questrial"))
|
|
60 |
# button_primary_background_fill="#281A39"
|
61 |
# )
|
62 |
ANNOUNCEMENT = """
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
71 |
|
72 |
-
|
73 |
|
74 |
ACADEMIC_PAPER = """## 一键生成论文初稿
|
75 |
1. 在Title文本框中输入想要生成的论文名称(比如Playing Atari with Deep Reinforcement Learning).
|
@@ -213,7 +217,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
213 |
info="生成论文的模板.")
|
214 |
model_selection = gr.Dropdown(label="Model", choices=["gpt-4", "gpt-3.5-turbo"],
|
215 |
value=DEFAULT_MODEL,
|
216 |
-
interactive=
|
217 |
info="生成论文用到的语言模型.")
|
218 |
prompts_mode = gr.Checkbox(value=False, visible=True, interactive=True,
|
219 |
label="Prompts模式",
|
|
|
40 |
IS_OPENAI_API_KEY_AVAILABLE = False
|
41 |
|
42 |
DEFAULT_MODEL = "gpt-4" if IS_OPENAI_API_KEY_AVAILABLE else "gpt-3.5-turbo"
|
43 |
+
GPT4_INTERACTIVE = True if IS_OPENAI_API_KEY_AVAILABLE else False
|
44 |
DEFAULT_SECTIONS = ["introduction", "related works", "backgrounds", "methodology", "experiments",
|
45 |
"conclusion", "abstract"] if IS_OPENAI_API_KEY_AVAILABLE \
|
46 |
else ["introduction", "related works"]
|
|
|
61 |
# button_primary_background_fill="#281A39"
|
62 |
# )
|
63 |
ANNOUNCEMENT = """
|
64 |
+
# Auto-Draft: 学术写作辅助工具
|
65 |
+
|
66 |
+
本Demo提供对[Auto-Draft](https://github.com/CCCBora/auto-draft)的auto_draft功能的测试.
|
67 |
+
通过输入想要生成的论文名称(比如Playing atari with deep reinforcement learning),即可由AI辅助生成论文模板.
|
68 |
+
|
69 |
+
***2023-06-13 Update***:
|
70 |
+
1. 新增‘高级选项-Prompts模式’. 这个模式仅会输出用于生成论文的Prompts而不会生成论文本身. 可以根据自己的需求修改Prompts, 也可以把Prompts复制给其他语言模型.
|
71 |
+
2. 把默认的ICLR 2022模板改成了Default模板. 不再显示ICLR的页眉页尾.
|
72 |
+
3. 使用GPT-4模型:
|
73 |
+
- 点击Duplicate this Space, 进入Settings-Repository secrets, 点击New Secret添加OPENAI_API_KEY为自己的OpenAI API Key
|
74 |
+
- 或者可以访问[Auto-Draft-Private](https://huggingface.co/spaces/auto-academic/auto-draft-private)
|
75 |
|
76 |
+
如果有更多想法和建议欢迎加入QQ群里交流, 如果我在Space里更新了Key我会第一时间通知大家. 群号: ***249738228***."""
|
77 |
|
78 |
ACADEMIC_PAPER = """## 一键生成论文初稿
|
79 |
1. 在Title文本框中输入想要生成的论文名称(比如Playing Atari with Deep Reinforcement Learning).
|
|
|
217 |
info="生成论文的模板.")
|
218 |
model_selection = gr.Dropdown(label="Model", choices=["gpt-4", "gpt-3.5-turbo"],
|
219 |
value=DEFAULT_MODEL,
|
220 |
+
interactive=GPT4_INTERACTIVE,
|
221 |
info="生成论文用到的语言模型.")
|
222 |
prompts_mode = gr.Checkbox(value=False, visible=True, interactive=True,
|
223 |
label="Prompts模式",
|