Spaces:
Sleeping
Sleeping
Create server.py
Browse files
server.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, request, jsonify
|
2 |
+
|
3 |
+
app = Flask(__name__)
|
4 |
+
|
5 |
+
@app.route('/')
|
6 |
+
def index():
|
7 |
+
return "Welcome to the AI application!"
|
8 |
+
|
9 |
+
@app.route('/predict', methods=['POST'])
|
10 |
+
def predict():
|
11 |
+
data = request.json
|
12 |
+
text = data.get('text')
|
13 |
+
# Add model prediction logic here
|
14 |
+
return jsonify({'prediction': 'example result'})
|
15 |
+
|
16 |
+
if __name__ == "__main__":
|
17 |
+
app.run(debug=True)
|