Spaces:
Sleeping
Sleeping
Debug
Browse files
app.py
CHANGED
@@ -41,15 +41,19 @@ def generate_prompt(
|
|
41 |
|
42 |
# Function to generate summary with the help of fine-tuned model
|
43 |
def Summary_Gen(Transcript):
|
|
|
44 |
prompt = generate_prompt(Transcript)
|
45 |
summary = model.generate(prompt=prompt,max_tokens=4096)
|
46 |
# summary_output = to_markdown(summary)
|
|
|
47 |
return summary_output
|
48 |
|
49 |
# Function for text summarization
|
50 |
def summarize_text(text):
|
|
|
51 |
# Your text summarization logic here (replaced with Summary_Gen)
|
52 |
summarized_text = Summary_Gen(text)
|
|
|
53 |
return summarized_text
|
54 |
|
55 |
|
@@ -65,16 +69,17 @@ option = st.selectbox(
|
|
65 |
)
|
66 |
|
67 |
|
68 |
-
summary_output = ""
|
69 |
col1, col2 = st.columns(2)
|
70 |
|
71 |
col1.title('Input')
|
72 |
col1.container(height=500, border=True).text_area("", option, height=1000)
|
73 |
if col1.button("Summarize"):
|
74 |
with st.spinner('Wait for it...'):
|
|
|
75 |
summary_output = summarize_text(option)
|
76 |
-
|
77 |
-
|
78 |
col2.title('Output')
|
79 |
col2.container(height=500, border=True).markdown(summary_output, unsafe_allow_html=True)
|
80 |
|
|
|
41 |
|
42 |
# Function to generate summary with the help of fine-tuned model
|
43 |
def Summary_Gen(Transcript):
|
44 |
+
print("Summary Gen Fucntion Start: ", Transcript)
|
45 |
prompt = generate_prompt(Transcript)
|
46 |
summary = model.generate(prompt=prompt,max_tokens=4096)
|
47 |
# summary_output = to_markdown(summary)
|
48 |
+
print("Summary Gen Fucntion End: ", summary)
|
49 |
return summary_output
|
50 |
|
51 |
# Function for text summarization
|
52 |
def summarize_text(text):
|
53 |
+
print("Summarize Text Function Start: ", text)
|
54 |
# Your text summarization logic here (replaced with Summary_Gen)
|
55 |
summarized_text = Summary_Gen(text)
|
56 |
+
print("Summarize Text Function End: ", summarized_text)
|
57 |
return summarized_text
|
58 |
|
59 |
|
|
|
69 |
)
|
70 |
|
71 |
|
72 |
+
summary_output = "Deafualt"
|
73 |
col1, col2 = st.columns(2)
|
74 |
|
75 |
col1.title('Input')
|
76 |
col1.container(height=500, border=True).text_area("", option, height=1000)
|
77 |
if col1.button("Summarize"):
|
78 |
with st.spinner('Wait for it...'):
|
79 |
+
print("Summary Function Start", summary_output)
|
80 |
summary_output = summarize_text(option)
|
81 |
+
print("Summary Function End", summary_output)
|
82 |
+
|
83 |
col2.title('Output')
|
84 |
col2.container(height=500, border=True).markdown(summary_output, unsafe_allow_html=True)
|
85 |
|