Skip to content

Commit

Permalink
Merge pull request #4339 from inspirehep/fix-grobid
Browse files Browse the repository at this point in the history
matcher: request explicitly XML format in grobid
  • Loading branch information
drjova authored Apr 17, 2024
2 parents fab1c19 + 341d633 commit 7c9cbbd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inspirehep/modules/workflows/tasks/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,11 @@ def post_pdf_to_grobid(obj, grobid_api_path, **kwargs):
data.update(kwargs)
grobid_url = current_app.config["GROBID_URL"]
try:
response = requests.post(urljoin(grobid_url, grobid_api_path), files=data)
response = requests.post(
urljoin(grobid_url, grobid_api_path),
files=data,
headers={'Accept': 'application/xml'}
)
response.raise_for_status()
except GROBID_EXCEPTIONS:
LOGGER.warning("(%s) Grobid request failed due to the GROBID serivce error!" % str(obj.id))
Expand Down

0 comments on commit 7c9cbbd

Please sign in to comment.