nhathuy07 commited on
Commit
966c4cd
·
verified ·
1 Parent(s): 996df88

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -195,10 +195,10 @@ async def __ocr(im, file_id):
195
 
196
  async def __convert2md(inp):
197
  # Use gfm-raw_html to strip styling data from source file
198
- return await __convert_text(inp.encode(), "gfm-raw_html", "html")
199
 
200
  async def __convert2plain(inp):
201
- return await __convert_text(inp.encode(), "plain", "html")
202
 
203
  def convert2md(req):
204
  pass
@@ -627,7 +627,7 @@ async def llm_generate_text(request):
627
  try:
628
  repl = _r.json()['choices'][0]['message']['content']
629
  # input, type_out="plain", type_in="html"
630
- repl = await __convert_text(repl.encode(), "html", "markdown")
631
  return PlainTextResponse(repl)
632
 
633
  except Exception as e:
 
195
 
196
  async def __convert2md(inp):
197
  # Use gfm-raw_html to strip styling data from source file
198
+ return await __convert_text(inp, "gfm-raw_html", "html")
199
 
200
  async def __convert2plain(inp):
201
+ return await __convert_text(inp, "plain", "html")
202
 
203
  def convert2md(req):
204
  pass
 
627
  try:
628
  repl = _r.json()['choices'][0]['message']['content']
629
  # input, type_out="plain", type_in="html"
630
+ repl = await __convert_text(repl, "html-raw_html", "markdown")
631
  return PlainTextResponse(repl)
632
 
633
  except Exception as e: