GCLing commited on
Commit
4eafa91
·
verified ·
1 Parent(s): dd2bb14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- def predict_text(text: str):
70
 
71
  def predict_text(text: str):
72
- print("predict_text called, text:", text)
 
 
 
 
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: