Spaces:
Build error
Build error
Download static/script.js from wesslen/fastapi-spacy-matcher: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/spaces/wesslen/fastapi-spacy-matcher/resolve/main/static/script.js
- Command line
-
hf download hf://spaces/wesslen/fastapi-spacy-matcher/static/script.js
-
curl -L -o script.js https://huggingface.co/spaces/wesslen/fastapi-spacy-matcher/resolve/main/static/script.js
668 Bytes
| const textSpacyForm = document.querySelector('.text-spacy-form'); | |
| const translateText = async (text) => { | |
| const inferResponse = await fetch(`score_text?text_input=${text}`); | |
| const inferJson = await inferResponse.json(); | |
| var jsonStr = JSON.stringify(inferJson); | |
| return jsonStr; | |
| }; | |
| textSpacyForm.addEventListener('submit', async (event) => { | |
| event.preventDefault(); | |
| const textSpacyInput = document.getElementById('text-spacy-input'); | |
| const textSpacyParagraph = document.querySelector('.text-spacy-output'); | |
| try { | |
| textSpacyParagraph.textContent = await translateText(textSpacyInput.value); | |
| } catch (err) { | |
| console.error(err); | |
| } | |
| }); |