Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,10 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import requests
|
| 3 |
|
| 4 |
HOST = "https://1tsnakers-ollamasearchapi.hf.space"
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
else:
|
| 12 |
-
st.header("AI table generator")
|
| 13 |
-
if st.button("Generate Table"):
|
| 14 |
-
try:
|
| 15 |
-
r = requests.get(
|
| 16 |
-
f"{API}/ping",
|
| 17 |
-
headers={"Host": HOST},
|
| 18 |
-
verify=False, # Koyeb uses a valid cert only for the hostname, not the IP
|
| 19 |
-
timeout=5
|
| 20 |
-
)
|
| 21 |
-
st.write(r.text)
|
| 22 |
-
except requests.exceptions.RequestException as e:
|
| 23 |
-
st.error(f"Connection failed: {e}")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import requests
|
| 3 |
|
| 4 |
HOST = "https://1tsnakers-ollamasearchapi.hf.space"
|
| 5 |
|
| 6 |
+
if st.button("make list"):
|
| 7 |
+
r = requests.get(f"{HOST}/ping")
|
| 8 |
+
|
| 9 |
+
if r.code() == 200:
|
| 10 |
+
st.write("yay")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|