Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,10 @@ pipe = pipeline("text2text-generation", model=model_id, max_length=1024)
|
|
8 |
|
9 |
def casual_model_function(input_text):
|
10 |
# Replace the line below with the code for your casual model
|
11 |
-
output_text = pipe(input_text)[0][
|
12 |
return output_text
|
|
|
|
|
13 |
text_input = gr.Textbox(lines=10, placeholder="Enter your text here", label="Your Text")
|
14 |
text_outputs = gr.Textbox(lines=10)
|
15 |
# submit_btn = gr.Button(value="Generate",variant="secondary")
|
@@ -18,8 +20,12 @@ interface = gr.Interface(
|
|
18 |
fn=casual_model_function,
|
19 |
inputs=text_input,
|
20 |
outputs=text_outputs,
|
|
|
|
|
|
|
|
|
21 |
# submit_btn=submit_btn,
|
22 |
)
|
23 |
|
24 |
if __name__ == "__main__":
|
25 |
-
interface.launch()
|
|
|
8 |
|
9 |
def casual_model_function(input_text):
|
10 |
# Replace the line below with the code for your casual model
|
11 |
+
output_text = pipe(input_text)[0]["generated_text"]
|
12 |
return output_text
|
13 |
+
|
14 |
+
|
15 |
text_input = gr.Textbox(lines=10, placeholder="Enter your text here", label="Your Text")
|
16 |
text_outputs = gr.Textbox(lines=10)
|
17 |
# submit_btn = gr.Button(value="Generate",variant="secondary")
|
|
|
20 |
fn=casual_model_function,
|
21 |
inputs=text_input,
|
22 |
outputs=text_outputs,
|
23 |
+
examples=[
|
24 |
+
["ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَـٰلَمِينَ", "ئەل حەمدو ليل لاهـى ڕەببـيل عالەمين"],
|
25 |
+
["ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ", "ئەڕ ڕەحمانـيـڕ ڕەحيم"],
|
26 |
+
],
|
27 |
# submit_btn=submit_btn,
|
28 |
)
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
+
interface.launch()
|