Spaces:
Runtime error
Runtime error
Download app.py from 13ze/hf-api-call: direct link, hf CLI and curl.
- Browser
- Download file 419 Bytes
-
https://huggingface.co/spaces/13ze/hf-api-call/resolve/main/app.py
- Command line
-
hf download hf://spaces/13ze/hf-api-call/app.py
-
curl -L -o app.py https://huggingface.co/spaces/13ze/hf-api-call/resolve/main/app.py
419 Bytes
| import requests | |
| url = 'https://api.jina.ai/v1/embeddings' | |
| headers = { | |
| 'Content-Type': 'application/json', | |
| 'Authorization': 'Bearer jina_4736efa15c0c4e6781a9407683e9e320g-IB4U8jC54rCaxEF5XfmaPfdLXF' | |
| } | |
| data = { | |
| 'input': ["Your text string goes here", "You can send multiple texts"], | |
| 'model': 'jina-embeddings-v2-base-en', | |
| 'encoding_type': 'float' | |
| } | |
| response = requests.post(url, headers=headers, json=data) | |