Spaces:
Runtime error
Runtime error
yuchenlin
commited on
Commit
ยท
5c4c520
1
Parent(s):
ba728b3
modify 8B code
Browse files
app_8B.py
CHANGED
|
@@ -9,11 +9,7 @@ header = """
|
|
| 9 |
# ๐ฆโโฌ MagpieLMs: Open LLMs with Fully Transparent Alignment Recipes
|
| 10 |
|
| 11 |
๐ฌ We've aligned Llama-3.1-8B and a 4B version (distilled by NVIDIA) using purely synthetic data generated by our [Magpie](https://arxiv.org/abs/2406.08464) method. Our open-source post-training recipe includes: SFT and DPO data, all training configs + logs. This allows everyone to reproduce the alignment process for their own research. Note that our data does not contain any GPT-generated data, and has a much friendly license for both commercial and academic use.
|
| 12 |
-
|
| 13 |
-
- **Magpie Collection**: [Magpie on Hugging Face](https://huggingface.co/collections/Magpie-Align/magpielm-66e2221f31fa3bf05b10786a)
|
| 14 |
-
- **Magpie Paper**: [Read the research paper](https://arxiv.org/abs/2406.08464)
|
| 15 |
-
|
| 16 |
-
Contact: [Zhangchen Xu](https://zhangchenxu.com) and [Bill Yuchen Lin](https://yuchenlin.xyz).
|
| 17 |
|
| 18 |
---
|
| 19 |
"""
|
|
@@ -76,8 +72,11 @@ def respond(
|
|
| 76 |
outputs.append(text)
|
| 77 |
yield "".join(outputs)
|
| 78 |
|
|
|
|
|
|
|
| 79 |
demo = gr.ChatInterface(
|
| 80 |
-
respond,
|
|
|
|
| 81 |
additional_inputs=[
|
| 82 |
gr.Textbox(value="You are Magpie, a helpful AI assistant. For simple queries, try to answer them directly; for complex questions, try to think step-by-step before providing an answer.", label="System message"),
|
| 83 |
gr.Slider(minimum=128, maximum=2048, value=512, step=64, label="Max new tokens"),
|
|
@@ -93,9 +92,17 @@ demo = gr.ChatInterface(
|
|
| 93 |
],
|
| 94 |
description=header, # Add the header as the description
|
| 95 |
title="MagpieLM-8B Chat (v0.1)",
|
| 96 |
-
theme=gr.themes.Soft()
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
demo.queue()
|
| 101 |
-
demo.launch(share=True)
|
|
|
|
| 9 |
# ๐ฆโโฌ MagpieLMs: Open LLMs with Fully Transparent Alignment Recipes
|
| 10 |
|
| 11 |
๐ฌ We've aligned Llama-3.1-8B and a 4B version (distilled by NVIDIA) using purely synthetic data generated by our [Magpie](https://arxiv.org/abs/2406.08464) method. Our open-source post-training recipe includes: SFT and DPO data, all training configs + logs. This allows everyone to reproduce the alignment process for their own research. Note that our data does not contain any GPT-generated data, and has a much friendly license for both commercial and academic use.
|
| 12 |
+
๐ Links: [**Magpie Collection**](https://huggingface.co/collections/Magpie-Align/magpielm-66e2221f31fa3bf05b10786a); [**Magpie Paper**](https://arxiv.org/abs/2406.08464) ๐ฎ Contact: [Zhangchen Xu](https://zhangchenxu.com) and [Bill Yuchen Lin](https://yuchenlin.xyz).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
---
|
| 15 |
"""
|
|
|
|
| 72 |
outputs.append(text)
|
| 73 |
yield "".join(outputs)
|
| 74 |
|
| 75 |
+
chatbot = gr.Chatbot(placeholder="<strong>MagpieLM-Chat-8B (v0.1)</strong>")
|
| 76 |
+
|
| 77 |
demo = gr.ChatInterface(
|
| 78 |
+
fn=respond,
|
| 79 |
+
chatbot=chatbot,
|
| 80 |
additional_inputs=[
|
| 81 |
gr.Textbox(value="You are Magpie, a helpful AI assistant. For simple queries, try to answer them directly; for complex questions, try to think step-by-step before providing an answer.", label="System message"),
|
| 82 |
gr.Slider(minimum=128, maximum=2048, value=512, step=64, label="Max new tokens"),
|
|
|
|
| 92 |
],
|
| 93 |
description=header, # Add the header as the description
|
| 94 |
title="MagpieLM-8B Chat (v0.1)",
|
| 95 |
+
theme=gr.themes.Soft(),
|
| 96 |
+
examples=[
|
| 97 |
+
["Hello, what is your name?"],
|
| 98 |
+
["Can you write a poem for me?"],
|
| 99 |
+
["What's the meaning of life?"],
|
| 100 |
+
]
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
# set a default message in the chatbox to start the conversation
|
| 104 |
+
# demo.chatbot.placeholder = "Hello! What's your name?"
|
| 105 |
|
| 106 |
if __name__ == "__main__":
|
| 107 |
demo.queue()
|
| 108 |
+
demo.launch(share=True, show_api=False)
|