Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,7 @@ def get_base64_image(image):
|
|
| 50 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 51 |
return f"data:image/jpeg;base64,{img_str}"
|
| 52 |
|
| 53 |
-
@spaces.GPU
|
| 54 |
def extract_vocabulary(pdf_text, images, translit_lang, translit_format, target_lang):
|
| 55 |
"""Use Transformers to extract vocabulary from text and images."""
|
| 56 |
global model, processor
|
|
@@ -160,7 +160,7 @@ def numpy_to_base64_audio(wav, sample_rate):
|
|
| 160 |
audio_base64 = base64.b64encode(buffer.read()).decode('utf-8')
|
| 161 |
return f"data:audio/wav;base64,{audio_base64}"
|
| 162 |
|
| 163 |
-
@spaces.GPU
|
| 164 |
def process_pdf(pdf_file, translit_lang, translit_format, target_lang):
|
| 165 |
global tts, voice_style
|
| 166 |
|
|
@@ -498,7 +498,7 @@ def create_demo():
|
|
| 498 |
)
|
| 499 |
return demo
|
| 500 |
|
| 501 |
-
@spaces.GPU
|
| 502 |
def main():
|
| 503 |
global model, processor, tts, voice_style
|
| 504 |
|
|
|
|
| 50 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 51 |
return f"data:image/jpeg;base64,{img_str}"
|
| 52 |
|
| 53 |
+
@spaces.GPU(duration=120)
|
| 54 |
def extract_vocabulary(pdf_text, images, translit_lang, translit_format, target_lang):
|
| 55 |
"""Use Transformers to extract vocabulary from text and images."""
|
| 56 |
global model, processor
|
|
|
|
| 160 |
audio_base64 = base64.b64encode(buffer.read()).decode('utf-8')
|
| 161 |
return f"data:audio/wav;base64,{audio_base64}"
|
| 162 |
|
| 163 |
+
@spaces.GPU(duration=120)
|
| 164 |
def process_pdf(pdf_file, translit_lang, translit_format, target_lang):
|
| 165 |
global tts, voice_style
|
| 166 |
|
|
|
|
| 498 |
)
|
| 499 |
return demo
|
| 500 |
|
| 501 |
+
@spaces.GPU(duration=120)
|
| 502 |
def main():
|
| 503 |
global model, processor, tts, voice_style
|
| 504 |
|