Spaces:
Build error
Build error
camparchimedes
commited on
Commit
•
af8451f
1
Parent(s):
23d2264
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ torch_dtype = torch.float32
|
|
28 |
|
29 |
pipe = pipeline("automatic-speech-recognition", model="NbAiLabBeta/nb-whisper-large", device=device, torch_dtype=torch_dtype)
|
30 |
|
31 |
-
|
32 |
|
33 |
# Initialize processor and pipeline
|
34 |
processor = AutoProcessor.from_pretrained("NbAiLabBeta/nb-whisper-large")
|
@@ -113,7 +113,7 @@ summarization_model = AutoModelForSeq2SeqLM.from_pretrained("t5-base", return_di
|
|
113 |
summarization_tokenizer = AutoTokenizer.from_pretrained("t5-base")
|
114 |
summarization_model.to(device)
|
115 |
|
116 |
-
|
117 |
def summarize_text(text):
|
118 |
preprocessed_text = preprocess_text(text)
|
119 |
if preprocessed_text is None:
|
@@ -200,7 +200,7 @@ from PIL import Image
|
|
200 |
|
201 |
def save_to_pdf(text, summary):
|
202 |
pdf = FPDF()
|
203 |
-
pdf.add_page()
|
204 |
pdf.set_font("Arial", size=12)
|
205 |
|
206 |
if text:
|
|
|
28 |
|
29 |
pipe = pipeline("automatic-speech-recognition", model="NbAiLabBeta/nb-whisper-large", device=device, torch_dtype=torch_dtype)
|
30 |
|
31 |
+
@spaces.GPU(queue=True)
|
32 |
|
33 |
# Initialize processor and pipeline
|
34 |
processor = AutoProcessor.from_pretrained("NbAiLabBeta/nb-whisper-large")
|
|
|
113 |
summarization_tokenizer = AutoTokenizer.from_pretrained("t5-base")
|
114 |
summarization_model.to(device)
|
115 |
|
116 |
+
@spaces.GPU(queue=True)
|
117 |
def summarize_text(text):
|
118 |
preprocessed_text = preprocess_text(text)
|
119 |
if preprocessed_text is None:
|
|
|
200 |
|
201 |
def save_to_pdf(text, summary):
|
202 |
pdf = FPDF()
|
203 |
+
pdf.add_page()
|
204 |
pdf.set_font("Arial", size=12)
|
205 |
|
206 |
if text:
|