add changes in pdf logic

changes:
   1. Remove `/` file (just missed click when create it);
   2. Add filename input for pdf;
   3. Now pdf file saves.
This commit is contained in:
swrneko
2025-09-09 18:24:18 +03:00
parent 240c39cab2
commit 83e19c471a
5 changed files with 21 additions and 38 deletions

View File

@@ -13,9 +13,9 @@ class ConvertMdToPdf:
text,
flags=re.DOTALL
)
pdf = MarkdownPdf(toc_level=2, optimize=True)
pdf = MarkdownPdf(toc_level=0, optimize=True)
pdf.add_section(Section(text))
return text
return pdf, text
def replace_math(self, match):
math_content = match.group(1) or match.group(2) # $$...$$ или $...$

View File

@@ -2,7 +2,7 @@ from faster_whisper import WhisperModel
class FasterWhisper:
def recognize(self, model, audioFile, beamSize, vadFilter, minSilenceDurationMs, speechPadMs, temp0, temp1, temp2, wordTimestamps, noSpeechThreshold, conditionOnPreviousText):
model = WhisperModel(model, device='auto', compute_type='auto') # Задаем модель
model = WhisperModel(model, device='cuda', compute_type='auto') # Задаем модель
segments, _ = model.transcribe( # Распознаем текст
audioFile,