Spaces:
Sleeping
Sleeping
Infinitode Pty Ltd
commited on
Update app.py
Browse files
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
|
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 =
|
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)
|
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 |
|