Spaces:
Build error
Build error
Commit
·
09a58d2
1
Parent(s):
420f35b
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def pool_span_scores(score_dicts, sent_lens):
|
|
27 |
r = [[TAGS[ps] for ps in sent_ps] for sent_ps in pooled_scores]
|
28 |
return r
|
29 |
|
30 |
-
def predict_label(text, model
|
31 |
model_path = 'models/span.model'
|
32 |
ip = text.split()
|
33 |
ip_len = [len(ip)]
|
@@ -57,7 +57,7 @@ if __name__ == '__main__':
|
|
57 |
model_path = 'models/span.model'
|
58 |
model = SpanNet.load_model(model_path)
|
59 |
# iface = gr.Interface(fn=temp, inputs="text", outputs="text", batch=False)
|
60 |
-
iface = gr.Interface(fn=predict_label, inputs="text", outputs="text")
|
61 |
iface.launch(share=True, blocked_paths=['models'])
|
62 |
iface.launch(show_api=False)
|
63 |
|
|
|
27 |
r = [[TAGS[ps] for ps in sent_ps] for sent_ps in pooled_scores]
|
28 |
return r
|
29 |
|
30 |
+
def predict_label(text, model):
|
31 |
model_path = 'models/span.model'
|
32 |
ip = text.split()
|
33 |
ip_len = [len(ip)]
|
|
|
57 |
model_path = 'models/span.model'
|
58 |
model = SpanNet.load_model(model_path)
|
59 |
# iface = gr.Interface(fn=temp, inputs="text", outputs="text", batch=False)
|
60 |
+
iface = gr.Interface(fn=predict_label(model=model), inputs="text", outputs="text")
|
61 |
iface.launch(share=True, blocked_paths=['models'])
|
62 |
iface.launch(show_api=False)
|
63 |
|