Infinitode Pty Ltd commited on
Commit
53200cd
·
verified ·
1 Parent(s): 2546a7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import random
3
  import gradio as gr
4
  import sentencepiece as spm
5
  import numpy as np
6
- import tflite_runtime.interpreter as tflite
7
 
8
  def custom_pad_sequences(sequences, maxlen, padding='pre', value=0):
9
  """
@@ -100,7 +100,7 @@ def generateTerrariaNames(amount, max_length=30, temperature=0.5, seed_text=""):
100
  max_seq_len = 12 # For skyrim = 13, for terraria = 12
101
 
102
  # Load TFLite model
103
- interpreter = tflite.Interpreter(model_path="models/dungen_terraria_model.tflite")
104
  interpreter.allocate_tensors()
105
 
106
  # Use the function to generate a name
@@ -112,7 +112,7 @@ def generateTerrariaNames(amount, max_length=30, temperature=0.5, seed_text=""):
112
 
113
  demo = gr.Interface(
114
  fn=generateTerrariaNames,
115
- inputs=[gr.Number(1,25), gr.Slider(10, 60), gr.Slider(0.01, 1), gr.Text(0,10)],
116
  outputs=["text"],
117
  )
118
 
 
3
  import gradio as gr
4
  import sentencepiece as spm
5
  import numpy as np
6
+ import tensorflow as tf
7
 
8
  def custom_pad_sequences(sequences, maxlen, padding='pre', value=0):
9
  """
 
100
  max_seq_len = 12 # For skyrim = 13, for terraria = 12
101
 
102
  # Load TFLite model
103
+ interpreter = tf.lite.Interpreter(model_path="models/dungen_terraria_model.tflite")
104
  interpreter.allocate_tensors()
105
 
106
  # Use the function to generate a name
 
112
 
113
  demo = gr.Interface(
114
  fn=generateTerrariaNames,
115
+ inputs=[gr.Number(1,25), gr.Slider(10, 60) gr.Slider(0.01, 1), gr.Text(0,10)],
116
  outputs=["text"],
117
  )
118