1TSnakers commited on
Commit
0a48207
·
verified ·
1 Parent(s): 23bcd3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -19
app.py CHANGED
@@ -1,23 +1,10 @@
1
  import streamlit as st
2
- import requests, socket
3
 
4
  HOST = "https://1tsnakers-ollamasearchapi.hf.space"
5
 
6
- try:
7
- ip = socket.gethostbyname(HOST)
8
- API = f"https://{ip}"
9
- except Exception as e:
10
- st.error(f"DNS resolution failed: {e}")
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")