SuperSecureHuman commited on
Commit
407fa6f
·
verified ·
1 Parent(s): 465d7e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -145,7 +145,24 @@ def create_interface_custom():
145
  return interface
146
 
147
 
 
 
 
 
 
 
 
 
 
 
 
148
  def main():
 
 
 
 
 
 
149
  logging.basicConfig(level=logging.INFO)
150
  interface = create_interface_custom()
151
  interface.launch()
@@ -153,3 +170,7 @@ def main():
153
 
154
  if __name__ == "__main__":
155
  main()
 
 
 
 
 
145
  return interface
146
 
147
 
148
+ def download_models():
149
+ import huggingface_hub
150
+
151
+ repo_name = "SuperSecureHuman/xray-reg-models"
152
+ local_dir = "./"
153
+ huggingface_hub.snapshot_download(
154
+ repo_id=repo_name,
155
+ local_dir=local_dir,
156
+ )
157
+
158
+
159
  def main():
160
+ # Download models if not already present
161
+ try:
162
+ download_models()
163
+ except Exception as e:
164
+ logging.error("Error downloading models: %s", e)
165
+ exit(1)
166
  logging.basicConfig(level=logging.INFO)
167
  interface = create_interface_custom()
168
  interface.launch()
 
170
 
171
  if __name__ == "__main__":
172
  main()
173
+
174
+
175
+ if __name__ == "__main__":
176
+ main()