Omnibus commited on
Commit
fe06229
·
1 Parent(s): 5da8dfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -21,12 +21,17 @@ function(text_input, url_params) {
21
  def predict(text, url_params):
22
  mod_url=""
23
  mod=None
24
- try:
25
- mod_url = url_params.get('url')
26
- print (mod_url)
27
- out = gr.HTML.update(f"""<h1>Loading model from:<br>{mod_url} </h1>""")
28
- except Exception:
 
 
 
 
29
  out=gr.HTML.update(f"""<h1>Enter Model URL</h1>""")
 
30
  return ["" + text + "", mod,out,mod_url]
31
 
32
  def find_model(url):
 
21
  def predict(text, url_params):
22
  mod_url=""
23
  mod=None
24
+ out = None
25
+ if url_params != None:
26
+ try:
27
+ mod_url = url_params.get('url')
28
+ #print (mod_url)
29
+ out = gr.HTML.update(f"""<h1>Loading model from:<br>{mod_url} </h1>""")
30
+ except Exception as e:
31
+ out=gr.HTML.update(f"""<h1>Enter Model URL</h1>""")
32
+ else:
33
  out=gr.HTML.update(f"""<h1>Enter Model URL</h1>""")
34
+
35
  return ["" + text + "", mod,out,mod_url]
36
 
37
  def find_model(url):