Spaces:
Runtime error
Runtime error
Faizan Azizahmed Shaikh
commited on
Commit
·
03fcc35
1
Parent(s):
b96c858
Fixed waiting time using queue and api_open
Browse files
app.py
CHANGED
|
@@ -20,8 +20,8 @@ def story(prompt="When I was young", model_name = "coffeeee/nsfw-story-generator
|
|
| 20 |
return create(prompt, max_new_tokens=story_length)[0]['generated_text']
|
| 21 |
|
| 22 |
# block framework to customize the io page
|
| 23 |
-
with gr.Blocks() as
|
| 24 |
-
gr.Markdown("#
|
| 25 |
gr.Label(value=WARNING, label="Disclaimer!!!")
|
| 26 |
story_start = gr.Textbox(label="Begin the storyline", value="This is about the time when I was 15 years old and living with")
|
| 27 |
selected_model = gr.Textbox(value="coffeeee/nsfw-story-generator2", label="Hugging Face Model To Use")
|
|
@@ -29,4 +29,6 @@ with gr.Blocks() as demo:
|
|
| 29 |
gen_story = gr.Textbox(label="Story", lines=15, max_lines=20)
|
| 30 |
greet_btn = gr.Button("Entertain")
|
| 31 |
greet_btn.click(fn=story, inputs=[story_start, selected_model, story_len], outputs=gen_story)
|
| 32 |
-
|
|
|
|
|
|
|
|
|
| 20 |
return create(prompt, max_new_tokens=story_length)[0]['generated_text']
|
| 21 |
|
| 22 |
# block framework to customize the io page
|
| 23 |
+
with gr.Blocks() as app:
|
| 24 |
+
gr.Markdown("# Story Generator, a delightful combo of HuggingFace API and Gradio.io")
|
| 25 |
gr.Label(value=WARNING, label="Disclaimer!!!")
|
| 26 |
story_start = gr.Textbox(label="Begin the storyline", value="This is about the time when I was 15 years old and living with")
|
| 27 |
selected_model = gr.Textbox(value="coffeeee/nsfw-story-generator2", label="Hugging Face Model To Use")
|
|
|
|
| 29 |
gen_story = gr.Textbox(label="Story", lines=15, max_lines=20)
|
| 30 |
greet_btn = gr.Button("Entertain")
|
| 31 |
greet_btn.click(fn=story, inputs=[story_start, selected_model, story_len], outputs=gen_story)
|
| 32 |
+
|
| 33 |
+
app.queue(api_open=False)
|
| 34 |
+
app.launch(inline=False, share=False)
|