Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,36 +1,12 @@
|
|
1 |
-
from diffusers import AutoPipelineForText2Image
|
2 |
-
import torch
|
3 |
-
|
4 |
-
pipe = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16").to("cuda")
|
5 |
-
|
6 |
-
import os
|
7 |
-
import shlex
|
8 |
-
import subprocess
|
9 |
-
from pathlib import Path
|
10 |
-
from typing import Union
|
11 |
-
|
12 |
import gradio as gr
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
with gr.Blocks(title=f"Realtime SDXL Turbo", css=".gradio-container {max-width: 544px !important}") as demo:
|
19 |
-
with gr.Row():
|
20 |
-
with gr.Column():
|
21 |
-
textbox = gr.Textbox(show_label=False, value="a close-up picture of a fluffy cat")
|
22 |
-
button = gr.Button()
|
23 |
-
with gr.Row(variant="default"):
|
24 |
-
output_image = gr.Image(
|
25 |
-
show_label=False,
|
26 |
-
type="pil",
|
27 |
-
interactive=False,
|
28 |
-
height=512,
|
29 |
-
width=512,
|
30 |
-
elem_id="output_image",
|
31 |
-
)
|
32 |
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
description = "Story generation with GPT-2"
|
4 |
+
title = "Generate your own story"
|
5 |
+
examples = [["Adventurer is approached by a mysterious stranger in the tavern for a new quest."]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
interface = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator",
|
8 |
+
description=description,
|
9 |
+
examples=examples
|
10 |
+
)
|
11 |
|
12 |
+
interface.launch()
|