waleko commited on
Commit
4ffdab4
·
1 Parent(s): 755b6ea

fix pix2tikz

Browse files
Files changed (1) hide show
  1. webui.py +8 -2
webui.py CHANGED
@@ -58,8 +58,14 @@ def pix2tikz(
58
  __: int,
59
  ___: bool,
60
  ):
61
- args = Munch({'config': os.path.realpath(os.path.join(os.path.dirname(__file__), 'pix2tikz/config.yaml')),
62
- 'checkpoint': os.path.realpath(os.path.join(os.path.dirname(__file__), checkpoint)),
 
 
 
 
 
 
63
  'no_resize': False,
64
  'temperature': temperature})
65
  model = LatexOCR(args)
 
58
  __: int,
59
  ___: bool,
60
  ):
61
+ cur_pwd = os.path.dirname(os.path.abspath(__file__))
62
+ config_path = os.path.join(cur_pwd, 'pix2tikz/config.yaml')
63
+ model_path = os.path.join(cur_pwd, checkpoint)
64
+
65
+ print(cur_pwd, config_path, model_path, os.path.exists(config_path), os.path.exists(model_path))
66
+
67
+ args = Munch({'config': config_path,
68
+ 'checkpoint': model_path,
69
  'no_resize': False,
70
  'temperature': temperature})
71
  model = LatexOCR(args)