spell / app.py
TRaw's picture
Update app.py
ffa268b
raw
history blame contribute delete
676 Bytes
from gradio import Interface, inputs
import requests
import json
interface = Interface()
@interface.input("text", type=str, placeholder="Enter some text")
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()