Spaces:
Build error
Build error
Download app.py from TRaw/spell: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/spaces/TRaw/spell/resolve/main/app.py
- Command line
-
hf download hf://spaces/TRaw/spell/app.py
-
curl -L -o app.py https://huggingface.co/spaces/TRaw/spell/resolve/main/app.py
676 Bytes
| from gradio import Interface, inputs | |
| import requests | |
| import json | |
| interface = Interface() | |
| def rephrase(text): | |
| response = requests.post( | |
| "https://api.respell.ai/v1/run", | |
| headers={"Authorization": "Bearer 6438355a-133a-4ad6-9674-a4f9be050cf8", | |
| "Accept": "application/json", | |
| "Content-Type": "application/json"}, | |
| data=json.dumps({"spellId": "d7nG5HU8tVLmI1AjlOrFR", | |
| "inputs": {"input": text}}) | |
| ) | |
| result = response.json()["outputs"][0]["output"] | |
| return result | |
| if __name__ == "__main__": | |
| interface.launch() |