Download traversaal.py from traversaal-ai-hackathon/zaz: direct link, hf CLI and curl.
- Browser
- Download file 646 Bytes
-
https://huggingface.co/traversaal-ai-hackathon/zaz/resolve/main/traversaal.py
- Command line
-
hf download hf://traversaal-ai-hackathon/zaz/traversaal.py
-
curl -L -o traversaal.py https://huggingface.co/traversaal-ai-hackathon/zaz/resolve/main/traversaal.py
646 Bytes
| import requests | |
| import streamlit as st | |
| import json | |
| import os | |
| def getResponse(query): | |
| url = "https://api-ares.traversaal.ai/live/predict" | |
| payload = { "query": [query] } | |
| headers = { | |
| "x-api-key": st.secrets["TRAVERSAAL"], | |
| "content-type": "application/json" | |
| } | |
| response = requests.post(url, json=payload, headers=headers) | |
| if response.status_code == 200: | |
| # Get the JSON content from the response | |
| json_content = response.json() | |
| # Specify the file path where you want to save the JSON content | |
| return json_content | |
| else: | |
| print(response.status_code) | |
| return " " | |