Spaces:
Build error
Build error
Commit
·
9b91aa6
1
Parent(s):
30325ed
Update app.py
Browse files
app.py
CHANGED
@@ -44,19 +44,18 @@ def temp(text):
|
|
44 |
print('STARTING ..')
|
45 |
# model_path = 'models/span.model'
|
46 |
# model = SpanNet.load_model(model_path)
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
iface = gr.Interface(fn=temp, inputs="text", outputs="text", batch=False)
|
58 |
-
|
59 |
-
iface.launch(share=True, blocked_paths=['models'])
|
60 |
-
|
61 |
-
iface.launch(show_api=False)
|
62 |
|
|
|
44 |
print('STARTING ..')
|
45 |
# model_path = 'models/span.model'
|
46 |
# model = SpanNet.load_model(model_path)
|
47 |
+
if __name__ == '__main__':
|
48 |
+
space_key = os.environ.get('key')
|
49 |
+
filenames = ['network.py', 'layers.py', 'utils.py', 'representation.py']
|
50 |
+
for file in filenames:
|
51 |
+
hf_hub_download('nehalelkaref/stagedNER',
|
52 |
+
filename=file,
|
53 |
+
local_dir='src',
|
54 |
+
token=space_key)
|
55 |
+
|
56 |
+
from src.network import SpanNet
|
57 |
+
# iface = gr.Interface(fn=temp, inputs="text", outputs="text", batch=False)
|
58 |
+
iface = gr.Interface(fn=predict_label, inputs="text", outputs="text",auth=True)
|
59 |
+
iface.launch(share=True, blocked_paths=['models'])
|
60 |
+
iface.launch(show_api=False)
|
|
|
61 |
|