{"id":19664845,"url":"https://github.com/fluxml/huggingfaceapi.jl","last_synced_at":"2025-02-27T03:43:21.575Z","repository":{"id":41199589,"uuid":"427660602","full_name":"FluxML/HuggingFaceApi.jl","owner":"FluxML","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-30T07:19:07.000Z","size":149,"stargazers_count":36,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T03:33:25.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FluxML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-13T12:36:32.000Z","updated_at":"2024-08-07T13:08:30.000Z","dependencies_parsed_at":"2024-11-11T16:29:27.691Z","dependency_job_id":null,"html_url":"https://github.com/FluxML/HuggingFaceApi.jl","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"f069e0b438331353b1f39caf4306128ac52ba460"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FHuggingFaceApi.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FHuggingFaceApi.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FHuggingFaceApi.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FHuggingFaceApi.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluxML","download_url":"https://codeload.github.com/FluxML/HuggingFaceApi.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240974468,"owners_count":19887302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T16:19:16.438Z","updated_at":"2025-02-27T03:43:21.549Z","avatar_url":"https://github.com/FluxML.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HuggingFaceApi\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://fluxml.ai/HuggingFaceApi.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://fluxml.ai/HuggingFaceApi.jl/dev)\n[![Build Status](https://github.com/FluxML/HuggingFaceApi.jl/workflows/CI/badge.svg)](https://github.com/FluxML/HuggingFaceApi.jl/actions)\n[![Coverage](https://codecov.io/gh/FluxML/HuggingFaceApi.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/FluxML/HuggingFaceApi.jl)\n\nPure Julia [Huggingface api](https://github.com/huggingface/huggingface_hub)\n\n\n# Example\n\n## Basic usage\n\n```julia\njulia\u003e using HuggingFaceApi\n\njulia\u003e file = hf_hub_download(\"lysandre/arxiv-nlp\", \"config.json\");\n\n# or equivalent to\njulia\u003e url = HuggingFaceURL(\"lysandre/arxiv-nlp\", \"config.json\")\nHuggingFaceURL(https://huggingface.co/lysandre/arxiv-nlp/resolve/main/config.json)\n\njulia\u003e file = HuggingFaceApi.cached_download(url);\n\njulia\u003e readlines(file)\n29-element Vector{String}:\n \"{\"\n \"  \\\"_num_labels\\\": 1,\"\n \"  \\\"activation_function\\\": \\\"gelu_new\\\",\"\n \"  \\\"attn_pdrop\\\": 0.1,\"\n ⋮\n \"  \\\"summary_type\\\": \\\"token_ids\\\",\"\n \"  \\\"summary_use_proj\\\": true,\"\n \"  \\\"vocab_size\\\": 50257\"\n \"}\"\n\n# remove cached file if don't need it anymore\njulia\u003e HuggingFaceApi.remove_cache(url; now=true)\n[ Info: 1 MyArtifact deleted (604.000 byte)\n\n\n```\n\n## Download from private repo\n\n```julia\njulia\u003e using HuggingFaceApi\n\njulia\u003e HuggingFaceApi.login(\"chengchingwen\");\npassword: \n\njulia\u003e private_file = HuggingFaceApi.hf_hub_download(\"chengchingwen/test_model_repo\", \"README.md\");\n\njulia\u003e readlines(private_file)\n1-element Vector{String}:\n \"TEST THIS private repo\"\n\njulia\u003e HuggingFaceApi.logout()\n\n```\n\n## Search the hub\n\n```julia\njulia\u003e HuggingFaceApi.list_models(; search = \"japanese\", filter = (\"pytorch\", \"text-classification\"), full=false, limit=5)\n\n5-element JSON3.Array{JSON3.Object, Base.CodeUnits{UInt8, String}, Vector{UInt64}}:\n {\n             \"id\": \"daigo/bert-base-japanese-sentiment\",\n        \"private\": false,\n   \"pipeline_tag\": \"text-classification\",\n        \"modelId\": \"daigo/bert-base-japanese-sentiment\"\n}\n {\n             \"id\": \"abhishek/autonlp-japanese-sentiment-59363\",\n        \"private\": false,\n   \"pipeline_tag\": \"text-classification\",\n        \"modelId\": \"abhishek/autonlp-japanese-sentiment-59363\"\n}\n {\n             \"id\": \"laboro-ai/distilbert-base-japanese-finetuned-livedoor\",\n        \"private\": false,\n   \"pipeline_tag\": \"text-classification\",\n        \"modelId\": \"laboro-ai/distilbert-base-japanese-finetuned-livedoor\"\n}\n {\n             \"id\": \"ptaszynski/yacis-electra-small-japanese-cyberbullying\",\n        \"private\": false,\n   \"pipeline_tag\": \"text-classification\",\n        \"modelId\": \"ptaszynski/yacis-electra-small-japanese-cyberbullying\"\n}\n {\n             \"id\": \"lewtun/bert-base-japanese-char-v2-finetuned-amazon-jap\",\n        \"private\": false,\n   \"pipeline_tag\": \"text-classification\",\n        \"modelId\": \"lewtun/bert-base-japanese-char-v2-finetuned-amazon-jap\"\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Fhuggingfaceapi.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluxml%2Fhuggingfaceapi.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Fhuggingfaceapi.jl/lists"}