{"id":22917340,"url":"https://github.com/munya-marinda/huggingface-inference-api-with-javascript","last_synced_at":"2025-04-01T12:45:44.729Z","repository":{"id":238301135,"uuid":"796281061","full_name":"Munya-Marinda/huggingface-inference-api-with-javascript","owner":"Munya-Marinda","description":"This website utilizes the Hugging Face API to generate image descriptions based on user-provided text input. The application is built with HTML, CSS, and JavaScript, and it leverages the facebook/bart-large-cnn model for generating textual summaries.","archived":false,"fork":false,"pushed_at":"2024-05-23T09:18:00.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T07:42:37.562Z","etag":null,"topics":["ai","aiwebapp","artificialintelligence","digitalart","huggingfaceapi","javascript","opensource","textsummarization","texttoimage","webdevelopment","webtech"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Munya-Marinda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-05T13:41:17.000Z","updated_at":"2024-11-19T07:52:31.000Z","dependencies_parsed_at":"2024-05-23T10:31:30.407Z","dependency_job_id":null,"html_url":"https://github.com/Munya-Marinda/huggingface-inference-api-with-javascript","commit_stats":null,"previous_names":["munya-marinda/huggingface-inference-api-with-javascript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Munya-Marinda%2Fhuggingface-inference-api-with-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Munya-Marinda%2Fhuggingface-inference-api-with-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Munya-Marinda%2Fhuggingface-inference-api-with-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Munya-Marinda%2Fhuggingface-inference-api-with-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Munya-Marinda","download_url":"https://codeload.github.com/Munya-Marinda/huggingface-inference-api-with-javascript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246642334,"owners_count":20810580,"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":["ai","aiwebapp","artificialintelligence","digitalart","huggingfaceapi","javascript","opensource","textsummarization","texttoimage","webdevelopment","webtech"],"created_at":"2024-12-14T06:17:39.181Z","updated_at":"2025-04-01T12:45:44.705Z","avatar_url":"https://github.com/Munya-Marinda.png","language":"HTML","readme":"# Huggingface Inference Api With Javascript\n\nThis website utilizes the Hugging Face API to generate image descriptions based on user-provided text input. The application is built with HTML, CSS, and JavaScript, and it leverages the `facebook/bart-large-cnn` model for generating textual summaries.\n\n![Screenshot 2024-05-23 at 11 17 02](https://github.com/Munya-Marinda/huggingface-inference-api-with-javascript/assets/84540577/441355b9-c4ce-414d-8f12-8d91996d3bb9)\n\n\n## Features\n\n- Input a text description and get a summarized version using the Hugging Face API.\n- Simple and intuitive user interface.\n- Asynchronous API calls for smooth user experience.\n\n## Requirements\n\n- A web browser (Chrome, Firefox, Safari, etc.).\n- An API token from Hugging Face.\n\n## Usage\n\n1. **Get your Hugging Face API token:**\n\n   If you don't have an API token, you need to create an account on [Hugging Face](https://huggingface.co/) and obtain your API token.\n\n2. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/Munya-Marinda/huggingface-inference-api-with-javascript\n   cd fusion-image-generator-website\n   ```\n\n3. **Open the HTML file:**\n\n   Open `index.html` in your preferred web browser.\n\n4. **Update the API token:**\n\n   Open the `script.js` file and replace `xxxxxxxxxxxxxxxxxxx` with your Hugging Face API token:\n\n   ```javascript\n   Authorization: \"Bearer xxxxxxxxxxxxxxxxxxx\",\n   ```\n\n5. **Enter text and generate summary:**\n\n   - Enter your text into the input field.\n   - Click the button to generate a summary.\n   - The summarized text will be displayed below the input field.\n\n## Example Code\n\nHere is a snippet of the JavaScript code used in this application:\n\n```javascript\nconst callAPI = () =\u003e {\n  console.log(\"callAPI. Hello World!\");\n\n  const paragraph = document.getElementById(\"text-input\");\n  const output = document.getElementById(\"text-output\");\n  const text = paragraph.value;\n\n  async function query(data) {\n    const response = await fetch(\n      \"https://api-inference.huggingface.co/models/facebook/bart-large-cnn\",\n      {\n        headers: {\n          Authorization: \"Bearer xxxxxxxxxxxxxxxxxxx\",\n        },\n        method: \"POST\",\n        body: JSON.stringify(data),\n      }\n    );\n    const result = await response.json();\n    return result;\n  }\n\n  query({\n    inputs: text,\n  }).then((response) =\u003e {\n    output.innerHTML = response[0]?.summary_text;\n  });\n};\n```\n\n## Note\n\n- Make sure you replace the placeholder `xxxxxxxxxxxxxxxxxxx` with your actual Hugging Face API token.\n- The input text provided can be any description you want to summarize.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request if you have any improvements or suggestions.\n\n## Contact\n\nFor any questions or support, please contact [munyathedev@gmail.com].\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunya-marinda%2Fhuggingface-inference-api-with-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmunya-marinda%2Fhuggingface-inference-api-with-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunya-marinda%2Fhuggingface-inference-api-with-javascript/lists"}