Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,7 @@ def generate_notes(transcript):
|
|
83 |
# how it should behave throughout the conversation.
|
84 |
{
|
85 |
"role": "system",
|
86 |
-
"content": "you are expert question generator from content. Generate one long question,possible number of short questions and mcqs.plz also provide the
|
87 |
},
|
88 |
# Set a user message for the assistant to respond to.
|
89 |
{
|
@@ -127,10 +127,10 @@ def generate_notes(transcript):
|
|
127 |
|
128 |
|
129 |
# Generate and save a structured PDF
|
130 |
-
pdf_path = create_pdf(res)
|
131 |
return pdf_path
|
132 |
|
133 |
-
def create_pdf(question):
|
134 |
pdf = FPDF()
|
135 |
pdf.add_page()
|
136 |
|
@@ -140,14 +140,14 @@ def create_pdf(question):
|
|
140 |
|
141 |
# Add transcription content
|
142 |
pdf.set_font("Arial", "", 12)
|
143 |
-
pdf.multi_cell(0, 10, f"Transcription:\n{
|
144 |
|
145 |
-
#
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
|
152 |
# # Add short questions
|
153 |
# pdf.set_font("Arial", "B", 14)
|
|
|
83 |
# how it should behave throughout the conversation.
|
84 |
{
|
85 |
"role": "system",
|
86 |
+
"content": "you are expert question generator from content. Generate one long question,possible number of short questions and mcqs.plz also provide the notes"
|
87 |
},
|
88 |
# Set a user message for the assistant to respond to.
|
89 |
{
|
|
|
127 |
|
128 |
|
129 |
# Generate and save a structured PDF
|
130 |
+
pdf_path = create_pdf(res,transcript)
|
131 |
return pdf_path
|
132 |
|
133 |
+
def create_pdf(question,transcript):
|
134 |
pdf = FPDF()
|
135 |
pdf.add_page()
|
136 |
|
|
|
140 |
|
141 |
# Add transcription content
|
142 |
pdf.set_font("Arial", "", 12)
|
143 |
+
pdf.multi_cell(0, 10, f"Transcription:\n{transcript.encode('latin1', 'replace').decode('latin1')}\n\n")
|
144 |
|
145 |
+
# Add long questions
|
146 |
+
pdf.set_font("Arial", "B", 14)
|
147 |
+
pdf.cell(200, 10, "Questions", ln=True)
|
148 |
+
pdf.set_font("Arial", "", 12)
|
149 |
+
for question in long_questions:
|
150 |
+
pdf.multi_cell(0, 10, f"- {question.encode('latin1', 'replace').decode('latin1')}\n")
|
151 |
|
152 |
# # Add short questions
|
153 |
# pdf.set_font("Arial", "B", 14)
|