lodhrangpt commited on
Commit
7fd87d1
·
verified ·
1 Parent(s): 91df437

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
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 summarized notes"
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{question.encode('latin1', 'replace').decode('latin1')}\n\n")
144
 
145
- # # Add long questions
146
- # pdf.set_font("Arial", "B", 14)
147
- # pdf.cell(200, 10, "Long 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)
 
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)