sapthesh commited on
Commit
f786362
Β·
verified Β·
1 Parent(s): 47b454a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -37,16 +37,22 @@ def classify_text(text):
37
  }
38
 
39
  # Create a Gradio interface
40
- iface = gr.Interface(
41
- fn=classify_text,
42
- inputs=gr.inputs.Textbox(lines=2, placeholder="Enter text here..."), # Corrected here
43
- outputs=[
44
- gr.outputs.Label(label="Predicted Class"),
45
- gr.outputs.Label(label="Probabilities")
46
- ],
47
- title="DeepSeek-V3 Text Classification",
48
- description="Classify text using the DeepSeek-V3 model."
49
- )
 
 
 
50
 
51
  # Launch the interface
52
- iface.launch()
 
 
 
 
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}")