Spaces:
Runtime error
Runtime error
kmkarakaya
commited on
Commit
·
a90174f
1
Parent(s):
78111c9
Update app.py
Browse files
app.py
CHANGED
@@ -24,31 +24,28 @@ def generate_review(prompt):
|
|
24 |
title="Turkish Review Generator: A GPT2 based Text Generator Trained with a Custom Dataset"
|
25 |
description= """Generate a review in Turkish by providing a prompt.
|
26 |
Generation takes 15-20 seconds on average.
|
27 |
-
|
28 |
-
Enjoy!
|
29 |
|
30 |
-
NOTE: Examples can sometimes generate ERROR. When you see ERROR on the screen just click SUBMIT. Model will generate text in 15-20 secs.
|
31 |
article = """<p style='text-align: center'>On YouTube:</p>
|
32 |
<p style='text-align: center'><a href='https://youtube.com/playlist?list=PLQflnv_s49v9d9w-L0S8XUXXdNks7vPBL' target='_blank'>How to Train a Hugging Face Causal Language Model from Scratch with a Custom Dataset and a Custom Tokenizer?</a></p>
|
33 |
<p style='text-align: center'><a href='https://youtube.com/playlist?list=PLQflnv_s49v8aajw6m9MRNbAAbL63flKD' target='_blank'>Hugging Face kütüphanesini kullanarak bir GPT2 Transformer Dil Modelini Kendi Veri Setimizle nasıl eğitip kullanabiliriz? (in Turkish)</a></p>
|
34 |
<p style='text-align: center'>On Medium:</p>
|
35 |
<p style='text-align: center'><a href='https://medium.com/deep-learning-with-keras/how-to-train-a-hugging-face-causal-language-model-from-scratch-8d08d038168f' target='_blank'>How to Train a Hugging Face Causal Language Model from Scratch with a Custom Dataset and a Custom Tokenizer?</a></p>"""
|
36 |
-
|
37 |
"Tatil için rezervasyon yaptırdım",
|
38 |
"Geçen ay sipariş verdiğim",
|
39 |
"Spor salonuna abone oldum"]
|
40 |
-
|
41 |
-
"Tatil için rezervasyon yaptırdım"]
|
42 |
|
43 |
demo = gr.Interface(fn=generate_review,
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
outputs="text",
|
48 |
-
examples=examples,
|
49 |
title=title,
|
50 |
description= description,
|
51 |
article = article
|
|
|
52 |
#allow_flagging="manual",
|
53 |
#flagging_options=["good","moderate", "non-sense", ]
|
54 |
#flagging_dir='./flags'
|
|
|
24 |
title="Turkish Review Generator: A GPT2 based Text Generator Trained with a Custom Dataset"
|
25 |
description= """Generate a review in Turkish by providing a prompt.
|
26 |
Generation takes 15-20 seconds on average.
|
27 |
+
Enjoy!"""
|
|
|
28 |
|
29 |
+
#NOTE: Examples can sometimes generate ERROR. When you see ERROR on the screen just click SUBMIT. Model will generate text in 15-20 secs.
|
30 |
article = """<p style='text-align: center'>On YouTube:</p>
|
31 |
<p style='text-align: center'><a href='https://youtube.com/playlist?list=PLQflnv_s49v9d9w-L0S8XUXXdNks7vPBL' target='_blank'>How to Train a Hugging Face Causal Language Model from Scratch with a Custom Dataset and a Custom Tokenizer?</a></p>
|
32 |
<p style='text-align: center'><a href='https://youtube.com/playlist?list=PLQflnv_s49v8aajw6m9MRNbAAbL63flKD' target='_blank'>Hugging Face kütüphanesini kullanarak bir GPT2 Transformer Dil Modelini Kendi Veri Setimizle nasıl eğitip kullanabiliriz? (in Turkish)</a></p>
|
33 |
<p style='text-align: center'>On Medium:</p>
|
34 |
<p style='text-align: center'><a href='https://medium.com/deep-learning-with-keras/how-to-train-a-hugging-face-causal-language-model-from-scratch-8d08d038168f' target='_blank'>How to Train a Hugging Face Causal Language Model from Scratch with a Custom Dataset and a Custom Tokenizer?</a></p>"""
|
35 |
+
examples=["Bir hafta önce aldığım cep telefonu",
|
36 |
"Tatil için rezervasyon yaptırdım",
|
37 |
"Geçen ay sipariş verdiğim",
|
38 |
"Spor salonuna abone oldum"]
|
39 |
+
|
|
|
40 |
|
41 |
demo = gr.Interface(fn=generate_review,
|
42 |
+
inputs= gr.Textbox(lines=5, label="Prompt", placeholder="enter or select a prompt below..."),
|
43 |
+
outputs= gr.Textbox(lines=5, label="Generated Review", placeholder="genereated review will be here..."),
|
44 |
+
#examples=examples,
|
|
|
|
|
45 |
title=title,
|
46 |
description= description,
|
47 |
article = article
|
48 |
+
default= "Geçen ay sipariş verdiğim"
|
49 |
#allow_flagging="manual",
|
50 |
#flagging_options=["good","moderate", "non-sense", ]
|
51 |
#flagging_dir='./flags'
|