Update app.py
Browse files
app.py
CHANGED
@@ -66,10 +66,14 @@ def predict_voice(audio):
|
|
66 |
labels = svm_model.classes_
|
67 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
68 |
|
69 |
-
|
70 |
|
71 |
def predict_text(text: str):
|
72 |
-
|
|
|
|
|
|
|
|
|
73 |
if not text or text.strip()=="":
|
74 |
return {}
|
75 |
try:
|
|
|
66 |
labels = svm_model.classes_
|
67 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
68 |
|
69 |
+
|
70 |
|
71 |
def predict_text(text: str):
|
72 |
+
# 这里至少要有一行缩进代码,不能留空
|
73 |
+
if not text or text.strip() == "":
|
74 |
+
return {}
|
75 |
+
# 其余逻辑...
|
76 |
+
|
77 |
if not text or text.strip()=="":
|
78 |
return {}
|
79 |
try:
|