Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
|
4 |
import torch
|
5 |
from IndicTransTokenizer import IndicProcessor
|
6 |
|
7 |
-
# Initialize the transliteration engine and model
|
8 |
e = XlitEngine(["gu", 'en'], beam_width=10, src_script_type="en")
|
9 |
model = AutoModelForSeq2SeqLM.from_pretrained("ai4bharat/indictrans2-indic-en-1B", trust_remote_code=True)
|
10 |
tokenizer = AutoTokenizer.from_pretrained("ai4bharat/indictrans2-indic-en-1B", trust_remote_code=True)
|
@@ -29,8 +28,7 @@ def translate_question(english_question):
|
|
29 |
outputs = ip.postprocess_batch(outputs, lang="eng_Latn")
|
30 |
return outputs
|
31 |
|
32 |
-
|
33 |
-
st.title("English to Gujarati Translation")
|
34 |
st.write("Enter your question in English:")
|
35 |
|
36 |
english_question = st.text_input("Question:")
|
|
|
4 |
import torch
|
5 |
from IndicTransTokenizer import IndicProcessor
|
6 |
|
|
|
7 |
e = XlitEngine(["gu", 'en'], beam_width=10, src_script_type="en")
|
8 |
model = AutoModelForSeq2SeqLM.from_pretrained("ai4bharat/indictrans2-indic-en-1B", trust_remote_code=True)
|
9 |
tokenizer = AutoTokenizer.from_pretrained("ai4bharat/indictrans2-indic-en-1B", trust_remote_code=True)
|
|
|
28 |
outputs = ip.postprocess_batch(outputs, lang="eng_Latn")
|
29 |
return outputs
|
30 |
|
31 |
+
st.title("Gujarati to English Translation")
|
|
|
32 |
st.write("Enter your question in English:")
|
33 |
|
34 |
english_question = st.text_input("Question:")
|