Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ import time
|
|
20 |
from human_text_detect import detect_human_text
|
21 |
import os
|
22 |
|
23 |
-
HF_TOKEN = os.getenv("HF_TOKEN")
|
24 |
|
25 |
app = Flask(__name__)
|
26 |
CORS(app)
|
@@ -65,10 +65,10 @@ def process_analysis(task_id, text, model_name, topic, threshold):
|
|
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} received_token {received_token}')
|
70 |
-
if received_token != HF_TOKEN:
|
71 |
-
|
72 |
|
73 |
# Get data
|
74 |
print('Get data')
|
@@ -90,9 +90,9 @@ def check_text():
|
|
90 |
|
91 |
@app.route('/detectHumanInAIText/getAnalyzeResults', methods=['GET'])
|
92 |
def get_results():
|
93 |
-
received_token = request.headers.get("HF_TOKEN")
|
94 |
-
if received_token != HF_TOKEN:
|
95 |
-
|
96 |
|
97 |
task_id = request.args.get('taskId')
|
98 |
|
|
|
20 |
from human_text_detect import detect_human_text
|
21 |
import os
|
22 |
|
23 |
+
# HF_TOKEN = os.getenv("HF_TOKEN")
|
24 |
|
25 |
app = Flask(__name__)
|
26 |
CORS(app)
|
|
|
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} received_token {received_token}')
|
70 |
+
# if received_token != HF_TOKEN:
|
71 |
+
# return jsonify({"error": "Unauthorized"}), 403 # Forbidden
|
72 |
|
73 |
# Get data
|
74 |
print('Get data')
|
|
|
90 |
|
91 |
@app.route('/detectHumanInAIText/getAnalyzeResults', methods=['GET'])
|
92 |
def get_results():
|
93 |
+
# received_token = request.headers.get("HF_TOKEN")
|
94 |
+
# if received_token != HF_TOKEN:
|
95 |
+
# return jsonify({"error": "Unauthorized"}), 403 # Forbidden
|
96 |
|
97 |
task_id = request.args.get('taskId')
|
98 |
|