myhloli commited on
Commit
153cf7f
·
1 Parent(s): 4754a56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -17,22 +17,22 @@ os.system('mineru-models-download -s huggingface -m all')
17
 
18
  try:
19
  with open('/home/user/mineru.json', 'r+') as file:
20
- config = json.load(file)
21
-
22
- delimiters = {
23
- 'display': {'left': '\\[', 'right': '\\]'},
24
- 'inline': {'left': '\\(', 'right': '\\)'}
25
- }
26
-
27
- config['latex-delimiter-config'] = delimiters
28
-
29
- if os.getenv('apikey'):
30
- config['llm-aided-config']['title_aided']['api_key'] = os.getenv('apikey')
31
- config['llm-aided-config']['title_aided']['enable'] = True
32
-
33
- file.seek(0) # 将文件指针移回文件开始位置
34
- file.truncate() # 截断文件,清除原有内容
35
- json.dump(config, file, indent=4) # 写入新内容
36
  except Exception as e:
37
  logger.exception(e)
38
 
 
17
 
18
  try:
19
  with open('/home/user/mineru.json', 'r+') as file:
20
+ config = json.load(file)
21
+
22
+ delimiters = {
23
+ 'display': {'left': '\\[', 'right': '\\]'},
24
+ 'inline': {'left': '\\(', 'right': '\\)'}
25
+ }
26
+
27
+ config['latex-delimiter-config'] = delimiters
28
+
29
+ if os.getenv('apikey'):
30
+ config['llm-aided-config']['title_aided']['api_key'] = os.getenv('apikey')
31
+ config['llm-aided-config']['title_aided']['enable'] = True
32
+
33
+ file.seek(0) # 将文件指针移回文件开始位置
34
+ file.truncate() # 截断文件,清除原有内容
35
+ json.dump(config, file, indent=4) # 写入新内容
36
  except Exception as e:
37
  logger.exception(e)
38