Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,11 @@ from transformers import AutoTokenizer, TFBertForSeq2SeqLM # Assuming TFBert mo
|
|
| 3 |
# Load tokenizer configurations
|
| 4 |
source_tokenizer = AutoTokenizer.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/source_tokenizer_config.json")
|
| 5 |
target_tokenizer = AutoTokenizer.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/target_tokenizer_config.json")
|
|
|
|
| 6 |
|
|
|
|
| 7 |
# Load the model (replace with your actual model path)
|
| 8 |
-
model = TFBertForSeq2SeqLM.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/transliteration_model.h5")
|
| 9 |
|
| 10 |
def translate(malayalam_text):
|
| 11 |
"""Function to perform Malayalam to English transliteration"""
|
|
|
|
| 3 |
# Load tokenizer configurations
|
| 4 |
source_tokenizer = AutoTokenizer.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/source_tokenizer_config.json")
|
| 5 |
target_tokenizer = AutoTokenizer.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/target_tokenizer_config.json")
|
| 6 |
+
from tensorflow.keras.models import load_model
|
| 7 |
|
| 8 |
+
model = load_model("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/transliteration_model.h5")
|
| 9 |
# Load the model (replace with your actual model path)
|
| 10 |
+
#model = TFBertForSeq2SeqLM.from_pretrained("https://huggingface.co/Bajiyo/mal_en_transliteration/tree/main/transliteration_model.h5")
|
| 11 |
|
| 12 |
def translate(malayalam_text):
|
| 13 |
"""Function to perform Malayalam to English transliteration"""
|