wintergw commited on
Commit
4ab71dc
·
verified ·
1 Parent(s): 005dc15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -16,15 +16,7 @@ cache_dir="private_space_cache"
16
  )
17
 
18
 
19
- #if you call functions from another file “importing files as modules”
20
- functions = hf_hub_download(
21
- repo_id="wintergw/assignment_opt_gurobi",
22
- filename="optmodel.py",
23
- repo_type="space",
24
- )
25
- spec = importlib.util.spec_from_file_location("*", functions)
26
- foo = importlib.util.module_from_spec(spec)
27
- spec.loader.exec_module(foo)
28
 
29
 
30
  # calling the app code
@@ -35,7 +27,17 @@ repo_type="space"
35
  )
36
 
37
  # executing the app file
38
- spec_app = importlib.util.spec_from_file_location("*",functions,app)
39
  app = importlib.util.module_from_spec(spec_app)
40
  spec_app.loader.exec_module(app)
41
 
 
 
 
 
 
 
 
 
 
 
 
16
  )
17
 
18
 
19
+
 
 
 
 
 
 
 
 
20
 
21
 
22
  # calling the app code
 
27
  )
28
 
29
  # executing the app file
30
+ spec_app = importlib.util.spec_from_file_location("*",app)
31
  app = importlib.util.module_from_spec(spec_app)
32
  spec_app.loader.exec_module(app)
33
 
34
+
35
+ #if you call functions from another file “importing files as modules”
36
+ functions = hf_hub_download(
37
+ repo_id="wintergw/assignment_opt_gurobi",
38
+ filename="optmodel.py",
39
+ repo_type="space",
40
+ )
41
+ spec = importlib.util.spec_from_file_location("*", functions)
42
+ foo = importlib.util.module_from_spec(spec)
43
+ spec.loader.exec_module(foo)