Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,24 @@
|
|
1 |
-
from huggingface_hub import from_pretrained_keras
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
-
# Load the model from Hugging Face
|
5 |
model = from_pretrained_keras("Bajiyo/Malayalam_transliteration")
|
6 |
|
7 |
def transliterate(input_text):
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
#
|
12 |
-
predictions = model.predict(preprocessed_text)
|
13 |
-
|
14 |
-
# Implement post-processing based on model's output format
|
15 |
output_text = post_process_predictions(predictions)
|
16 |
-
|
17 |
return output_text
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface_hub import from_pretrained_keras
|
3 |
|
4 |
+
# Load the model from Hugging Face
|
5 |
model = from_pretrained_keras("Bajiyo/Malayalam_transliteration")
|
6 |
|
7 |
def transliterate(input_text):
|
8 |
+
# Make predictions using the model directly
|
9 |
+
predictions = model.predict(input_text)
|
10 |
+
|
11 |
+
# Post-process the predictions if needed
|
|
|
|
|
|
|
12 |
output_text = post_process_predictions(predictions)
|
13 |
+
|
14 |
return output_text
|
15 |
|
16 |
+
textbox = gr.inputs.Textbox(label="Enter Malayalam Text")
|
17 |
+
|
18 |
+
demo = gr.Interface(fn=transliterate,
|
19 |
+
inputs=textbox,
|
20 |
+
outputs=gr.outputs.Textbox(label="Transliteration to English"),
|
21 |
+
title="Malayalam to English Transliteration"
|
22 |
+
)
|
23 |
+
|
24 |
+
demo.launch()
|