Spaces:
Sleeping
Sleeping
Update blueprints/summarize.py
Browse files- blueprints/summarize.py +2 -2
blueprints/summarize.py
CHANGED
|
@@ -88,11 +88,11 @@ def api_summarize():
|
|
| 88 |
|
| 89 |
if not data or 'text' not in data:
|
| 90 |
return jsonify({"error": "No text provided"}), 400
|
| 91 |
-
|
| 92 |
config = {
|
| 93 |
"text": data['text'],
|
| 94 |
"model_name": data.get('model_name', "facebook/bart-large-cnn"),
|
| 95 |
-
"hf_token": data.get('hf_token',
|
| 96 |
# We force this for the specific summarization UI,
|
| 97 |
# but the backend logic supports others.
|
| 98 |
"task_type": "SEQ_2_SEQ_LM"
|
|
|
|
| 88 |
|
| 89 |
if not data or 'text' not in data:
|
| 90 |
return jsonify({"error": "No text provided"}), 400
|
| 91 |
+
hf_token = os.environ.get("HF_TOKEN","")
|
| 92 |
config = {
|
| 93 |
"text": data['text'],
|
| 94 |
"model_name": data.get('model_name', "facebook/bart-large-cnn"),
|
| 95 |
+
"hf_token": data.get('hf_token', hf_token)
|
| 96 |
# We force this for the specific summarization UI,
|
| 97 |
# but the backend logic supports others.
|
| 98 |
"task_type": "SEQ_2_SEQ_LM"
|