Spaces:
Sleeping
Sleeping
Suchinthana
commited on
Commit
•
851d58a
1
Parent(s):
f2b94ee
Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +11,16 @@ def generate_sinhala_text(prompt):
|
|
11 |
generated_text = generator3("writeWiki:"+prompt, do_sample=True, max_length=50)[0]['generated_text']
|
12 |
return generated_text
|
13 |
|
|
|
|
|
|
|
|
|
14 |
iface = gr.Interface(
|
15 |
fn=generate_sinhala_text,
|
16 |
inputs=gr.Textbox(label="Topic Here"),
|
17 |
outputs=gr.Textbox(lines=3, placeholder="Result Comes Here...", label="Output"),
|
|
|
|
|
18 |
)
|
19 |
|
20 |
iface.launch()
|
|
|
11 |
generated_text = generator3("writeWiki:"+prompt, do_sample=True, max_length=50)[0]['generated_text']
|
12 |
return generated_text
|
13 |
|
14 |
+
# Define the function to display loader
|
15 |
+
def loading():
|
16 |
+
return "Loading... Please wait."
|
17 |
+
|
18 |
iface = gr.Interface(
|
19 |
fn=generate_sinhala_text,
|
20 |
inputs=gr.Textbox(label="Topic Here"),
|
21 |
outputs=gr.Textbox(lines=3, placeholder="Result Comes Here...", label="Output"),
|
22 |
+
live=loading, # Add the loading function here
|
23 |
+
capture_session=True # Add capture_session parameter
|
24 |
)
|
25 |
|
26 |
iface.launch()
|