Pedro Cuenca commited on
Commit
6be3159
1 Parent(s): eb6780a

Get backend url from environment variable.

Browse files

Former-commit-id: 6545fc9be1704f4082f608b1eaa5d92a01f3feaa

Files changed (1) hide show
  1. app/app_gradio_ngrok.py +4 -1
app/app_gradio_ngrok.py CHANGED
@@ -10,6 +10,9 @@ import base64
10
 
11
  import gradio as gr
12
 
 
 
 
13
 
14
  def compose_predictions(images, caption=None):
15
  increased_h = 0 if caption is None else 48
@@ -30,7 +33,7 @@ class ServiceError(Exception):
30
 
31
  def get_images_from_ngrok(prompt):
32
  r = requests.post(
33
- "https://dd7123a7e01c.ngrok.io/generate",
34
  json={"prompt": prompt}
35
  )
36
  if r.status_code == 200:
 
10
 
11
  import gradio as gr
12
 
13
+ # If we use streamlit, this would be exported as a streamlit secret
14
+ import os
15
+ backend_url = os.environ["BACKEND_SERVER"]
16
 
17
  def compose_predictions(images, caption=None):
18
  increased_h = 0 if caption is None else 48
 
33
 
34
  def get_images_from_ngrok(prompt):
35
  r = requests.post(
36
+ backend_url,
37
  json={"prompt": prompt}
38
  )
39
  if r.status_code == 200: