Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# def translate_and_speak(text):
|
| 2 |
# input_text = "en " + text
|
| 3 |
# encoded = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True).to(device)
|
|
@@ -15,13 +22,6 @@
|
|
| 15 |
# audio_path = fp.name
|
| 16 |
|
| 17 |
# return sanskrit_text, audio_path
|
| 18 |
-
from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer
|
| 19 |
-
import torch
|
| 20 |
-
from gtts import gTTS
|
| 21 |
-
import gradio as gr
|
| 22 |
-
import tempfile
|
| 23 |
-
|
| 24 |
-
|
| 25 |
# Load model and tokenizer
|
| 26 |
model__name="Rask6723/IT_GR7_En-Sn"
|
| 27 |
|
|
|
|
| 1 |
+
|
| 2 |
+
from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer
|
| 3 |
+
import torch
|
| 4 |
+
from gtts import gTTS
|
| 5 |
+
import gradio as gr
|
| 6 |
+
import tempfile
|
| 7 |
+
|
| 8 |
# def translate_and_speak(text):
|
| 9 |
# input_text = "en " + text
|
| 10 |
# encoded = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True).to(device)
|
|
|
|
| 22 |
# audio_path = fp.name
|
| 23 |
|
| 24 |
# return sanskrit_text, audio_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Load model and tokenizer
|
| 26 |
model__name="Rask6723/IT_GR7_En-Sn"
|
| 27 |
|