You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a submit_paper() method to the HfApi class to allow authors to submit papers to Daily Papers on Hugging Face Hub. This endpoint is currently available via /api/papers/submit.
Endpoint Specs
API Endpoint:POST /api/papers/submit
inputs:
paper_id (required): ArXiv ID of the paper to submit.
comment (optional): Text comment about the paper.
media_urls (optional): List of media URLs associated with the paper.
limitations:
User must have at least one paper on HF to submit.
cannot submit papers on weekends.
Regular users limited to X submissions per day.
Papers older than 7 days cannot be submitted.
Same paper cannot be submitted twice.
The server throws HTTP errors in these cases.
Implementation Details
@validate_hf_hub_argsdefsubmit_paper(
self,
paper_id: str,
*,
comment: Optional[str] =None,
media_urls: Optional[List[str]] =None,
token: Union[bool, str, None] =None,
) ->None:
"""Submit a paper to the Daily Papers feed. Note: - You must have at least one paper on HF to submit. - You cannot submit papers on weekends. - The number of submissions per day is limited. - Papers older than 7 days cannot be submitted. - Same paper cannot be submitted twice. Args: paper_id (`str`): The ArXiv ID of the paper to submit (e.g. "2401.12345") comment (`str`, *optional*): An optional comment about the paper media_urls (`List[str]`, *optional*): Optional list of media URLs to attach to the submission token (`Union[bool, str, None]`, *optional*): Authentication token. Required. Returns: None Raises: - ValueError if submission criteria not met - HTTPError for various failure cases """
Tests
We still need to figure out how to run tests properly in the staging environment hub-ci. We need to have a dummy user with at least one paper submitted and find how to mock the paper submission date. ⚠️ Not sure if it's worth investing too much time on the tests here given the limited usage.
The text was updated successfully, but these errors were encountered:
Feature request from @NielsRogge and @AK391, slack thread here (private).
Description
Add a
submit_paper()
method to theHfApi
class to allow authors to submit papers to Daily Papers on Hugging Face Hub. This endpoint is currently available via/api/papers/submit
.Endpoint Specs
API Endpoint:
POST /api/papers/submit
inputs:
paper_id
(required): ArXiv ID of the paper to submit.comment
(optional): Text comment about the paper.media_urls
(optional): List of media URLs associated with the paper.limitations:
The server throws HTTP errors in these cases.
Implementation Details
Tests
We still need to figure out how to run tests properly in the staging environment hub-ci. We need to have a dummy user with at least one paper submitted and find how to mock the paper submission date.
⚠️ Not sure if it's worth investing too much time on the tests here given the limited usage.
The text was updated successfully, but these errors were encountered: