imperialwool commited on
Commit
b1b7ebb
1 Parent(s): c1c0388

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -112,7 +112,7 @@ def sentimentAnalys():
112
  predicted_sentiment = model.config.id2label[predicted_sentiment_index]
113
 
114
  return {"status": "pass", "predicted_sentiment": predicted_sentiment}
115
- except: return {"status": "error", "details": { "error_code": 123, "error_details": str(e).replace("\n", " | ") }}
116
 
117
  @app.route('/analyzeText/api/v1/detectLang', methods=['GET', 'POST'])
118
  def langDetect():
@@ -128,7 +128,7 @@ def langDetect():
128
  predicted_language = model.config.id2label[predicted_language_index]
129
 
130
  return {"status": "pass", "predicted_language": predicted_language}
131
- except: return {"status": "error", "details": { "error_code": 123, "error_details": str(e).replace("\n", " | ") }}
132
 
133
  if __name__ == "__main__":
134
  config = configFile()
 
112
  predicted_sentiment = model.config.id2label[predicted_sentiment_index]
113
 
114
  return {"status": "pass", "predicted_sentiment": predicted_sentiment}
115
+ except Exception as e: return {"status": "error", "details": { "error_code": 123, "error_details": str(e).replace("\n", " | ") }}
116
 
117
  @app.route('/analyzeText/api/v1/detectLang', methods=['GET', 'POST'])
118
  def langDetect():
 
128
  predicted_language = model.config.id2label[predicted_language_index]
129
 
130
  return {"status": "pass", "predicted_language": predicted_language}
131
+ except Exception as e: return {"status": "error", "details": { "error_code": 123, "error_details": str(e).replace("\n", " | ") }}
132
 
133
  if __name__ == "__main__":
134
  config = configFile()