Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,8 @@ response = requests.get(file_url)
|
|
57 |
|
58 |
with open("model.pt", "wb") as f:
|
59 |
f.write(response.content)
|
60 |
-
|
|
|
61 |
# model_load_path = "model.pt"
|
62 |
# model = BertForSTS()
|
63 |
# model.load_state_dict(torch.load(model_load_path))
|
@@ -73,12 +74,12 @@ with open("model.pt", "wb") as f:
|
|
73 |
|
74 |
# return sim
|
75 |
|
76 |
-
#
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
# # Launch the Gradio interface
|
84 |
iface.launch()
|
|
|
57 |
|
58 |
with open("model.pt", "wb") as f:
|
59 |
f.write(response.content)
|
60 |
+
f.close()
|
61 |
+
|
62 |
# model_load_path = "model.pt"
|
63 |
# model = BertForSTS()
|
64 |
# model.load_state_dict(torch.load(model_load_path))
|
|
|
74 |
|
75 |
# return sim
|
76 |
|
77 |
+
# Create a Gradio interface with a text input zone
|
78 |
+
iface = gr.Interface(
|
79 |
+
fn=analyze_text, # The function to be called with user input
|
80 |
+
inputs=[gr.Textbox(), gr.Textbox()],
|
81 |
+
outputs="text" # Display the result as text
|
82 |
+
)
|
83 |
|
84 |
# # Launch the Gradio interface
|
85 |
iface.launch()
|