Bajiyo commited on
Commit
0688df4
·
verified ·
1 Parent(s): 4beb772

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,10 +1,15 @@
1
  import gradio as gr
2
  from keras.models import load_model
3
  from keras.preprocessing.sequence import pad_sequences
 
4
 
5
  # Load your custom Keras model
6
  model = load_model('/content/drive/MyDrive/best_model.h5')
7
 
 
 
 
 
8
  # Function for transliteration
9
  def transliterate_malayalam_to_english(malayalam_text):
10
  # Tokenize and preprocess the input (adjust this based on your preprocessing logic)
@@ -27,4 +32,4 @@ iface = gr.Interface(
27
  )
28
 
29
  # Launch the Gradio interface
30
- iface.launch()
 
1
  import gradio as gr
2
  from keras.models import load_model
3
  from keras.preprocessing.sequence import pad_sequences
4
+ from keras.preprocessing.text import Tokenizer
5
 
6
  # Load your custom Keras model
7
  model = load_model('/content/drive/MyDrive/best_model.h5')
8
 
9
+ # Assuming 'source_tokenizer' is the tokenizer used during training
10
+ # You may need to adapt this based on your actual tokenizer
11
+ tokenizer = source_tokenizer
12
+
13
  # Function for transliteration
14
  def transliterate_malayalam_to_english(malayalam_text):
15
  # Tokenize and preprocess the input (adjust this based on your preprocessing logic)
 
32
  )
33
 
34
  # Launch the Gradio interface
35
+ iface.launch()