mirror of
https://github.com/tcsenpai/youlama.git
synced 2025-06-06 11:15:38 +00:00
fixed a rephrase problem
This commit is contained in:
parent
7c99592fe0
commit
baa906c11a
13
src/main.py
13
src/main.py
@ -160,6 +160,10 @@ st.markdown(
|
||||
if "messages" not in st.session_state:
|
||||
st.session_state.messages = []
|
||||
|
||||
# Initialize session state for rephrased transcript if not exists
|
||||
if "rephrased_transcript" not in st.session_state:
|
||||
st.session_state.rephrased_transcript = None
|
||||
|
||||
# Create a single header container
|
||||
header = st.container()
|
||||
|
||||
@ -418,8 +422,9 @@ def main():
|
||||
with st.spinner("Rephrasing transcript..."):
|
||||
ollama_client = OllamaClient(ollama_url, selected_model)
|
||||
prompt = f"Rephrase the following transcript to make it more readable and well-formatted, keeping the main content intact:\n\n{summary['transcript']}"
|
||||
rephrased = ollama_client.generate(prompt)
|
||||
st.markdown(rephrased)
|
||||
st.session_state.rephrased_transcript = ollama_client.generate(
|
||||
prompt
|
||||
)
|
||||
|
||||
if st.button("📋 Share"):
|
||||
try:
|
||||
@ -448,6 +453,10 @@ URL: {video_url}
|
||||
st.subheader("📊 AI Summary")
|
||||
st.markdown(summary["summary"])
|
||||
|
||||
# After the rephrase button, add:
|
||||
if st.session_state.rephrased_transcript:
|
||||
st.markdown(st.session_state.rephrased_transcript)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user