Jiangxz commited on
Commit
4f7c1e1
·
verified ·
1 Parent(s): 1b9ccfd

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -120,12 +120,12 @@ def generate_document(sender, receiver, subject_text, description_text, api_key)
120
  <foreignObject x="60" y="120" width="360" height="160">
121
  <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'SF Pro Text'; font-size: 18px; color: #2b2b2b;">
122
  <div style="margin-bottom: 10px;">受文者:[正本機關]</div>
123
- <div style="margin-bottom: 10px;">發文日期:中華民國114年XXXX日</div>
124
  <div style="margin-bottom: 10px;">發文字號:OOO字第114OOOOOOOO號</div>
125
  <div>速別:普通件</div>
126
  </div>
127
  </foreignObject>
128
- <foreignObject x="430" y="120" width="290" height="160">
129
  <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'SF Pro Text'; font-size: 18px; color: #666666;">
130
  <div style="margin-bottom: 10px;">地址:10000臺北市OO區OO街OO號OO樓</div>
131
  <div style="margin-bottom: 10px;">承辦人:OOO</div>
@@ -172,7 +172,6 @@ def generate_document(sender, receiver, subject_text, description_text, api_key)
172
  ],
173
  temperature=0.7
174
  )
175
- # Use stricter regex to extract SVG content
176
  result = response.choices[0].message.content
177
  svg_match = re.search(r'<svg[\s\S]*?<\/svg>', result, re.IGNORECASE)
178
  if svg_match:
@@ -366,4 +365,4 @@ if __name__ == "__main__":
366
  if "SPACE_ID" in os.environ:
367
  iface.launch()
368
  else:
369
- iface.launch(share=True, show_api=False)
 
120
  <foreignObject x="60" y="120" width="360" height="160">
121
  <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'SF Pro Text'; font-size: 18px; color: #2b2b2b;">
122
  <div style="margin-bottom: 10px;">受文者:[正本機關]</div>
123
+ <div style="margin-bottom: 10px;">發文日期:中華民國114年OOOO日</div>
124
  <div style="margin-bottom: 10px;">發文字號:OOO字第114OOOOOOOO號</div>
125
  <div>速別:普通件</div>
126
  </div>
127
  </foreignObject>
128
+ <foreignObject x="420" y="120" width="290" height="160">
129
  <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'SF Pro Text'; font-size: 18px; color: #666666;">
130
  <div style="margin-bottom: 10px;">地址:10000臺北市OO區OO街OO號OO樓</div>
131
  <div style="margin-bottom: 10px;">承辦人:OOO</div>
 
172
  ],
173
  temperature=0.7
174
  )
 
175
  result = response.choices[0].message.content
176
  svg_match = re.search(r'<svg[\s\S]*?<\/svg>', result, re.IGNORECASE)
177
  if svg_match:
 
365
  if "SPACE_ID" in os.environ:
366
  iface.launch()
367
  else:
368
+ iface.launch(share=True, show_api=False)