Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -37,16 +37,22 @@ def classify_text(text):
|
|
37 |
}
|
38 |
|
39 |
# Create a Gradio interface
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
50 |
|
51 |
# Launch the interface
|
52 |
-
|
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
# Create a Gradio interface
|
40 |
+
try:
|
41 |
+
iface = gr.Interface(
|
42 |
+
fn=classify_text,
|
43 |
+
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter text here..."), # Corrected here
|
44 |
+
outputs=[
|
45 |
+
gr.outputs.Label(label="Predicted Class"),
|
46 |
+
gr.outputs.Label(label="Probabilities")
|
47 |
+
],
|
48 |
+
title="DeepSeek-V3 Text Classification",
|
49 |
+
description="Classify text using the DeepSeek-V3 model."
|
50 |
+
)
|
51 |
+
except Exception as e:
|
52 |
+
print(f"Failed to create Gradio interface: {e}")
|
53 |
|
54 |
# Launch the interface
|
55 |
+
try:
|
56 |
+
iface.launch()
|
57 |
+
except Exception as e:
|
58 |
+
print(f"Failed to launch Gradio interface: {e}")
|