Spaces:
Running
Running
peter szemraj
commited on
Commit
·
9c05832
1
Parent(s):
7ebc4fb
:art: create advanced params section
Browse files
app.py
CHANGED
@@ -95,7 +95,7 @@ def get_parser():
|
|
95 |
default_prompt = """
|
96 |
Hello,
|
97 |
|
98 |
-
Following up on the bubblegum shipment."""
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
logging.info("\n\n\nStarting new instance of app.py")
|
@@ -115,9 +115,9 @@ if __name__ == "__main__":
|
|
115 |
logging.info("launching interface...")
|
116 |
|
117 |
with demo:
|
118 |
-
gr.Markdown("#
|
119 |
gr.Markdown(
|
120 |
-
"Enter part of an email, and the model will
|
121 |
)
|
122 |
gr.Markdown("---")
|
123 |
|
@@ -139,9 +139,21 @@ if __name__ == "__main__":
|
|
139 |
minimum=32,
|
140 |
step=16,
|
141 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
num_beams = gr.Radio(
|
143 |
choices=[4, 8, 16],
|
144 |
-
label="
|
145 |
value=4,
|
146 |
)
|
147 |
no_repeat_ngram_size = gr.Radio(
|
@@ -152,14 +164,6 @@ if __name__ == "__main__":
|
|
152 |
length_penalty = gr.Slider(
|
153 |
minimum=0.5, maximum=1.0, label="length penalty", value=0.8, step=0.1
|
154 |
)
|
155 |
-
generated_email = gr.Textbox(
|
156 |
-
label="Generated Result",
|
157 |
-
placeholder="The completed email will appear here",
|
158 |
-
)
|
159 |
-
|
160 |
-
generate_button = gr.Button(
|
161 |
-
"Generate!",
|
162 |
-
)
|
163 |
gr.Markdown("---")
|
164 |
|
165 |
with gr.Column():
|
@@ -169,7 +173,7 @@ if __name__ == "__main__":
|
|
169 |
"This model is a fine-tuned version of distilgpt2 on a dataset of 50k emails sourced from the internet, including the classic `aeslc` dataset."
|
170 |
)
|
171 |
gr.Markdown(
|
172 |
-
"The intended use of this model is to provide suggestions to _auto-complete_ the rest of your email. Said another way, it should serve as a **tool to write predictable emails faster**. It is not intended to write entire emails; at least **some input** is required to guide the direction of the model.\n\nPlease verify any suggestions by the model for A) False claims and B) negation statements before accepting/sending something."
|
173 |
)
|
174 |
gr.Markdown("---")
|
175 |
|
|
|
95 |
default_prompt = """
|
96 |
Hello,
|
97 |
|
98 |
+
Following up on the bubblegum shipment. We need"""
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
logging.info("\n\n\nStarting new instance of app.py")
|
|
|
115 |
logging.info("launching interface...")
|
116 |
|
117 |
with demo:
|
118 |
+
gr.Markdown("# Auto-Completing Emails - Demo")
|
119 |
gr.Markdown(
|
120 |
+
"Enter part of an email, and the text-generation model will complete it for you! The model used is [postbot/distilgpt2-emailgen](https://huggingface.co/postbot/distilgpt2-emailgen). Check out the model card for details on notebook & command line usage."
|
121 |
)
|
122 |
gr.Markdown("---")
|
123 |
|
|
|
139 |
minimum=32,
|
140 |
step=16,
|
141 |
)
|
142 |
+
|
143 |
+
generated_email = gr.Textbox(
|
144 |
+
label="Generated Result",
|
145 |
+
placeholder="The completed email will appear here",
|
146 |
+
)
|
147 |
+
generate_button = gr.Button(
|
148 |
+
"Generate!",
|
149 |
+
)
|
150 |
+
|
151 |
+
gr.Markdown("## Advanced Options")
|
152 |
+
gr.Markdown("See details about these parameters [here](https://huggingface.co/blog/how-to-generate), otherwise they should be fine as-is.")
|
153 |
+
|
154 |
num_beams = gr.Radio(
|
155 |
choices=[4, 8, 16],
|
156 |
+
label="Number of Beams",
|
157 |
value=4,
|
158 |
)
|
159 |
no_repeat_ngram_size = gr.Radio(
|
|
|
164 |
length_penalty = gr.Slider(
|
165 |
minimum=0.5, maximum=1.0, label="length penalty", value=0.8, step=0.1
|
166 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
gr.Markdown("---")
|
168 |
|
169 |
with gr.Column():
|
|
|
173 |
"This model is a fine-tuned version of distilgpt2 on a dataset of 50k emails sourced from the internet, including the classic `aeslc` dataset."
|
174 |
)
|
175 |
gr.Markdown(
|
176 |
+
"The intended use of this model is to provide suggestions to _auto-complete_ the rest of your email. Said another way, it should serve as a **tool to write predictable emails faster**. It is not intended to write entire emails from scratch; at least **some input** is required to guide the direction of the model.\n\nPlease verify any suggestions by the model for A) False claims and B) negation statements **before** accepting/sending something."
|
177 |
)
|
178 |
gr.Markdown("---")
|
179 |
|