Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,22 +4,23 @@ from langchain_google_genai import ChatGoogleGenerativeAI
|
|
| 4 |
st.title("Text Summarizer")
|
| 5 |
|
| 6 |
def generate_summary(text):
|
| 7 |
-
prompt = f"
|
| 8 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=st.secrets["API_KEY"])
|
| 9 |
summary = llm.invoke(prompt)
|
| 10 |
summary = summary.content
|
| 11 |
return summary
|
| 12 |
|
| 13 |
with st.form("text_summarizer_form"):
|
| 14 |
-
|
| 15 |
-
submitted = st.form_submit_button("
|
| 16 |
|
| 17 |
-
if submitted and
|
| 18 |
-
|
| 19 |
-
st.subheader("
|
| 20 |
-
st.write(
|
| 21 |
-
elif submitted and not
|
| 22 |
-
st.error("Please enter
|
|
|
|
| 23 |
|
| 24 |
if st.button("Need Inspiration?"):
|
| 25 |
-
st.write("
|
|
|
|
| 4 |
st.title("Text Summarizer")
|
| 5 |
|
| 6 |
def generate_summary(text):
|
| 7 |
+
prompt = f"Generate workable scenes from the following script: {script}"
|
| 8 |
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=st.secrets["API_KEY"])
|
| 9 |
summary = llm.invoke(prompt)
|
| 10 |
summary = summary.content
|
| 11 |
return summary
|
| 12 |
|
| 13 |
with st.form("text_summarizer_form"):
|
| 14 |
+
script = st.text_area("Enter the script or screenplay")
|
| 15 |
+
submitted = st.form_submit_button("Generate Scenes")
|
| 16 |
|
| 17 |
+
if submitted and script:
|
| 18 |
+
scenes = generate_scenes(script)
|
| 19 |
+
st.subheader("Generated Scenes:")
|
| 20 |
+
st.write(scenes)
|
| 21 |
+
elif submitted and not script:
|
| 22 |
+
st.error("Please enter a script to generate scenes.")
|
| 23 |
+
|
| 24 |
|
| 25 |
if st.button("Need Inspiration?"):
|
| 26 |
+
st.write("Breaking down a script into scenes can help visualize the flow of the story better. Try it out!")
|