Grey01 commited on
Commit
3e49101
·
verified ·
1 Parent(s): 95bf8eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,8 +1,10 @@
1
  import gradio as gr
2
  import streamlit as st
 
3
  from gradio_client import Client
4
 
5
- client = Client("https://b2e7dc20663679013e.gradio.live/")
 
6
  st.title('Digital Ink')
7
 
8
 
@@ -17,8 +19,8 @@ for message in st.session_state.messages:
17
  st.markdown(message["content"])
18
 
19
  def get_response(prompt):
20
- #using gradio api client to generate response
21
- response = client.predict(prompt,api_name="/predict")
22
  return response
23
 
24
  # User input
 
1
  import gradio as gr
2
  import streamlit as st
3
+ import requests
4
  from gradio_client import Client
5
 
6
+ ngrok_tunnel_url = "ngrok-python/1.4.0 ngrok-rust/0.14.0-pre.14L"
7
+
8
  st.title('Digital Ink')
9
 
10
 
 
19
  st.markdown(message["content"])
20
 
21
  def get_response(prompt):
22
+ response = requests.post(f"{ngrok_tunnel_url}/predict", json={"text": prompt})
23
+ return response.json()["output"]
24
  return response
25
 
26
  # User input