Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def process_analysis(task_id, text, model_name, topic, threshold):
|
|
65 |
|
66 |
@app.route('/detectHumanInAIText/checkText', methods=['POST'])
|
67 |
def check_text():
|
68 |
-
|
69 |
print(f'HF_TOKEN {HF_TOKEN}')
|
70 |
# if received_token != HF_TOKEN:
|
71 |
# return jsonify({"error": "Unauthorized"}), 403 # Forbidden
|
@@ -86,7 +86,7 @@ def check_text():
|
|
86 |
thread.start()
|
87 |
|
88 |
# Return taskId immediately
|
89 |
-
return jsonify({'taskId':
|
90 |
|
91 |
@app.route('/detectHumanInAIText/getAnalyzeResults', methods=['GET'])
|
92 |
def get_results():
|
|
|
65 |
|
66 |
@app.route('/detectHumanInAIText/checkText', methods=['POST'])
|
67 |
def check_text():
|
68 |
+
received_token = request.headers.get("HF_TOKEN")
|
69 |
print(f'HF_TOKEN {HF_TOKEN}')
|
70 |
# if received_token != HF_TOKEN:
|
71 |
# return jsonify({"error": "Unauthorized"}), 403 # Forbidden
|
|
|
86 |
thread.start()
|
87 |
|
88 |
# Return taskId immediately
|
89 |
+
return jsonify({'taskId': received_token}), 202
|
90 |
|
91 |
@app.route('/detectHumanInAIText/getAnalyzeResults', methods=['GET'])
|
92 |
def get_results():
|