Spaces:
Running
Running
Update main.py
Browse files
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
|
199 |
|
200 |
async def __convert2plain(inp):
|
201 |
-
return await __convert_text(inp
|
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
|
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:
|