Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,26 +1,4 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
return "This is a placeholder summary for the movie script you entered. Your model will go here."
|
| 6 |
-
|
| 7 |
-
def dummy_summary_from_file(file):
|
| 8 |
-
text = file.read().decode("utf-8")
|
| 9 |
-
return dummy_summary(text)
|
| 10 |
-
|
| 11 |
-
with gr.Blocks() as demo:
|
| 12 |
-
gr.Markdown("# 🎬 Movie Script Summarizer (Demo)")
|
| 13 |
-
gr.Markdown("Paste your screenplay or upload a `.txt` file. This is a placeholder version. Model will be added soon.")
|
| 14 |
-
|
| 15 |
-
with gr.Tab("📋 Paste Script"):
|
| 16 |
-
input_text = gr.Textbox(lines=20, label="Movie Script")
|
| 17 |
-
output_text = gr.Textbox(label="Summary")
|
| 18 |
-
btn = gr.Button("Summarize")
|
| 19 |
-
btn.click(fn=dummy_summary, inputs=input_text, outputs=output_text)
|
| 20 |
-
|
| 21 |
-
with gr.Tab("📂 Upload .txt File"):
|
| 22 |
-
file_input = gr.File(label="Upload a Script (.txt)", file_types=[".txt"])
|
| 23 |
-
file_summary = gr.Textbox(label="Summary")
|
| 24 |
-
file_input.change(fn=dummy_summary_from_file, inputs=file_input, outputs=file_summary)
|
| 25 |
-
|
| 26 |
-
demo.launch()
|
|
|
|
| 1 |
+
from utils import chunk_script
|
| 2 |
|
| 3 |
+
chunks = chunk_script(user_input)
|
| 4 |
+
summary = summarizer(chunks[0])[0]['summary_text']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|