jonathang commited on
Commit
be2a07b
1 Parent(s): 10692da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -96,9 +96,12 @@ def get_model():
96
  return model2
97
 
98
 
99
- def greet(name):
100
- get_model()
101
- return f"Input is {name}. Processed input is {Sequence.prepare(name)}"
 
 
 
102
 
103
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
104
  iface.launch()
 
96
  return model2
97
 
98
 
99
+ model = get_model()
100
+
101
+ def greet(seq):
102
+ processed_seq = Sequence.prepare(seq)
103
+ raw_prediction = model.predict(processed_seq)
104
+ return f"Input is {seq}.\nProcessed input is:\n{processed_seq}\n\nModel makes prediction:\n{raw_prediction}"
105
 
106
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
107
  iface.launch()