Omnibus commited on
Commit
ef7a625
·
1 Parent(s): 5597d94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -26,11 +26,11 @@ def predict(text, url_params):
26
  mod_url = url_params.get('url')
27
  if mod_url != None:
28
  #print (mod_url)
29
- out = gr.HTML.update(f"""<h1>Loading model from:<br>{mod_url} </h1>""")
30
  else:
31
- out=gr.HTML.update(f"""<h1>Enter Model URL</h1>""")
32
  except Exception as e:
33
- out=gr.HTML.update(f"""<h1>Enter Model URL</h1>""")
34
 
35
  return ["" + text + "", mod,out,mod_url]
36
 
@@ -41,18 +41,19 @@ def find_model(url):
41
  try:
42
  mod = gr.HTML(f'''
43
  <div>
44
- <model-viewer src="{url}" camera-controls poster="https://cdn.glitch.global/fe6d4fc5-58dd-43de-a65d-7bd5b477e8e1/poster.webp?v=1696812691961" shadow-intensity="1">Could not Load</model-viewer>
45
  </div>
46
  ''')
47
 
48
  except Exception as e:
49
- out = gr.HTML(f'''<h1>Could not find Model</h1><br><h3>System Message: {e}''')
50
  else:
51
- out = gr.HTML(f'''<h1>Enter Model URL</h1>''')
52
  return mod,out
53
 
54
 
55
  with gr.Blocks(css="style.css") as app:
 
56
  with gr.Tab("GLB/GLTF"):
57
  with gr.Row():
58
  inp = gr.Textbox(label="URL")
@@ -66,7 +67,6 @@ with gr.Blocks(css="style.css") as app:
66
  </div>
67
  """)
68
  '''
69
- markdown = gr.HTML("""""")
70
 
71
  with gr.Row(visible=False):
72
  text_input=gr.Textbox()
 
26
  mod_url = url_params.get('url')
27
  if mod_url != None:
28
  #print (mod_url)
29
+ out = gr.HTML.update(f"""<div><h1>Loading model from:<br>{mod_url} </h1></div>""")
30
  else:
31
+ out=gr.HTML.update(f"""<div><h1>Enter Model URL</h1></div>""")
32
  except Exception as e:
33
+ out=gr.HTML.update(f"""<div><h1>Enter Model URL</h1></div>""")
34
 
35
  return ["" + text + "", mod,out,mod_url]
36
 
 
41
  try:
42
  mod = gr.HTML(f'''
43
  <div>
44
+ <model-viewer src="{url}" camera-controls poster="https://cdn.glitch.global/fe6d4fc5-58dd-43de-a65d-7bd5b477e8e1/poster.webp?v=1696812691961" shadow-intensity="1"></model-viewer>
45
  </div>
46
  ''')
47
 
48
  except Exception as e:
49
+ out = gr.HTML(f'''<div><h1>Could not find Model</h1><br><h3>System Message: {e}</div>''')
50
  else:
51
+ out = gr.HTML(f'''<div><h1>Enter Model URL</h1></div>''')
52
  return mod,out
53
 
54
 
55
  with gr.Blocks(css="style.css") as app:
56
+ markdown = gr.HTML("""""")
57
  with gr.Tab("GLB/GLTF"):
58
  with gr.Row():
59
  inp = gr.Textbox(label="URL")
 
67
  </div>
68
  """)
69
  '''
 
70
 
71
  with gr.Row(visible=False):
72
  text_input=gr.Textbox()