Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
generator = pipeline("summarization", model="kriton/greek-text-summarization")
|
5 |
+
|
6 |
+
|
7 |
+
def generate_text(prompt):
|
8 |
+
response = generator(prompt, max_length=100, num_return_sequences=1)
|
9 |
+
return response[0]["generated_text"]
|
10 |
+
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=generate_text,
|
13 |
+
inputs="text",
|
14 |
+
outputs="text",
|
15 |
+
title="Remote LLM Text Generation",
|
16 |
+
description="Enter a prompt to generate text from the model."
|
17 |
+
)
|
18 |
+
|
19 |
+
# Launch the Gradio interface
|
20 |
+
iface.launch()
|