Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import tensorflow as tf
|
|
|
2 |
from flask import Flask, request, jsonify
|
3 |
|
4 |
app = Flask(__name__)
|
5 |
|
6 |
# Load the model
|
7 |
-
|
|
|
8 |
|
9 |
@app.route('/predict', methods=['POST'])
|
10 |
def predict():
|
@@ -26,6 +28,4 @@ def postprocess_predictions(predictions):
|
|
26 |
pass
|
27 |
|
28 |
if __name__ == '__main__':
|
29 |
-
app.run(debug=True)
|
30 |
-
## API Endpoints
|
31 |
-
- **POST /predict**: Receives JSON data, returns model predictions.
|
|
|
1 |
import tensorflow as tf
|
2 |
+
from transformers import TFBertForSequenceClassification
|
3 |
from flask import Flask, request, jsonify
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
|
7 |
# Load the model
|
8 |
+
model_name = "Erfan11/Neuracraft"
|
9 |
+
model = TFBertForSequenceClassification.from_pretrained(model_name, use_auth_token="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")
|
10 |
|
11 |
@app.route('/predict', methods=['POST'])
|
12 |
def predict():
|
|
|
28 |
pass
|
29 |
|
30 |
if __name__ == '__main__':
|
31 |
+
app.run(debug=True)
|
|
|
|