Spaces:
Runtime error
Runtime error
Abdul Jaweed commited on
Commit ·
e6d5b7b
1
Parent(s): 2b80fd3
gradio ui added
Browse files- .vscode/settings.json +3 -0
- app.py +6 -10
.vscode/settings.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"terminal.integrated.allowChords": false
|
| 3 |
+
}
|
app.py
CHANGED
|
@@ -1,17 +1,13 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def predict(promt):
|
| 8 |
-
summary = model(promt)[0]("summary_text")
|
| 9 |
return summary
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
with gr.Blocks() as demo:
|
| 14 |
-
textbox = gr.Textbox(placeholder="Enter the block to summarize", lines=4)
|
| 15 |
-
gr.Interface(fn=predict, inputs=textbox, outputs="text")
|
| 16 |
-
|
| 17 |
-
demo.launch()
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
model = pipeline("summarization")
|
| 5 |
|
| 6 |
+
def predict(prompt):
|
| 7 |
+
summary = model(prompt)[0]["summary_text"]
|
|
|
|
|
|
|
| 8 |
return summary
|
| 9 |
|
| 10 |
+
textbox = gr.Textbox(placeholder="Enter the block to summarize", lines=4)
|
| 11 |
+
interface = gr.Interface(fn=predict, inputs=textbox, outputs="text", title="Text Summarization by Abdul Jaweed")
|
| 12 |
|
| 13 |
+
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|