Aboge commited on
Commit
d3eee90
·
1 Parent(s): 582958d
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -6,6 +6,12 @@ app = Flask(__name__)
6
  translator = pipeline("translation", model="Bildad/Swahili-English_Translation")
7
 
8
 
 
 
 
 
 
 
9
  @app.route("/translate", methods=["POST"])
10
  def translate():
11
  data = request.get_json()
 
6
  translator = pipeline("translation", model="Bildad/Swahili-English_Translation")
7
 
8
 
9
+ @app.route("/", methods=["GET"])
10
+ def home():
11
+ message = "Welcome to ChatEasy swa-eng translation API\n To use send a POST request to /translate"
12
+
13
+ return jsonify({"Welcome": message})
14
+
15
  @app.route("/translate", methods=["POST"])
16
  def translate():
17
  data = request.get_json()