Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,12 +59,38 @@ def get_image(url):
|
|
| 59 |
def main():
|
| 60 |
prompt = "Hello world, I'm vizard,"
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
ui.launch(enable_queue=True)
|
| 69 |
|
| 70 |
# pipe = pipeline(task="image-classification", model="microsoft/dit-base-finetuned-rvlcdip")
|
|
|
|
| 59 |
def main():
|
| 60 |
prompt = "Hello world, I'm vizard,"
|
| 61 |
|
| 62 |
+
gpt2_pipe = get_gpt2_pipeline()
|
| 63 |
+
def greet(prompt):
|
| 64 |
+
return gpt2_pipe(prompt, max_length=1000, num_return_sequences=3)
|
| 65 |
+
|
| 66 |
+
with gr.Blocks() as ui:
|
| 67 |
+
with gr.Row():
|
| 68 |
+
with gr.Column():
|
| 69 |
+
gpt_int = gr.Interface(
|
| 70 |
+
fn=greet,
|
| 71 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter some text here..."),
|
| 72 |
+
outputs="text",
|
| 73 |
+
title="GPT2",
|
| 74 |
+
description="OneDesc",
|
| 75 |
+
)
|
| 76 |
+
with gr.Row():
|
| 77 |
+
with gr.Column():
|
| 78 |
+
gpt_int2 = gr.Interface(
|
| 79 |
+
fn=greet,
|
| 80 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter some text here..."),
|
| 81 |
+
outputs="text",
|
| 82 |
+
title="GPT2",
|
| 83 |
+
description="OneDesc",
|
| 84 |
+
)
|
| 85 |
+
gr.Examples(['one.png', 'two.png', 'three.jpeg'])
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
# ui = gr.Interface.from_pipeline(
|
| 89 |
+
# get_text_summarizer_pipeline(),
|
| 90 |
+
# title="OneTitle",
|
| 91 |
+
# description="OneDesc",
|
| 92 |
+
# examples=['one.png', 'two.png', 'three.jpeg'],
|
| 93 |
+
# )
|
| 94 |
ui.launch(enable_queue=True)
|
| 95 |
|
| 96 |
# pipe = pipeline(task="image-classification", model="microsoft/dit-base-finetuned-rvlcdip")
|