galai
galai copied to clipboard
TypeError: clean() got an unexpected keyword argument 'css_sanitizer'
when i run the following code:
model = gal.load_model("base")
prompt = "The Riemann zeta function is given by:\n\n\\["
output = model.generate(prompt, max_new_tokens=60)
display_latex(output)
it gives me the following error:
│ J:/tx_generation/glactica/glactica.py:8 in <module> │
│ │
│ 5 model = gal.load_model("base") │
│ 6 prompt = "The Riemann zeta function is given by:\n\n\\[" │
│ 7 output = model.generate(prompt, max_new_tokens=60) │
│ > 8 display_latex(output) │
│ 9 │
│ │
│ D:\2020exe\Anaconda3\lib\site-packages\galai\notebook_utils.py:102 in │
│ display_latex │
│ │
│ 99 │ # normalize LaTeX tags │
│ 100 │ text = text.replace(r"\(", "$").replace(r"\)", "$").replace(r"\[" │
│ 101 │ # the text is going to be parsed as │
│ > 102 │ text = clean_html(text, tags=[], attributes=[], css_sanitizer=[]) │
│ 103 │ # use IPython.display.HTML instead of IPython.display.Latex so th │
│ 104 │ # rendered properly on notebook load without cells reevaluations │
│ 105 │ return HTML(text) │
│ │
│ D:\2020exe\Anaconda3\lib\site-packages\galai\notebook_utils.py:67 in │
│ clean_html │
│ │
│ 64 │ │ value, │
│ 65 │ │ tags=tags, │
│ 66 │ │ attributes=attributes, │
│ > 67 │ │ css_sanitizer=css_sanitizer, │
│ 68 │ ) │
│ 69 │ │
│ 70 │ return cleaned
TypeError: clean() got an unexpected keyword argument 'css_sanitizer'
Hi @fengyunzaidushi, thanks for reporting. What is your bleach
version?
Hi @fengyunzaidushi, thanks for reporting. What is your
bleach
version?
thank you for your reply: bleach=3.1.0 galai == 1.1.2 python=3.7 ide= pycharm i run it with cpu.
Thanks @fengyunzaidushi for the details. I updated the bleach version in requirements.txt (~=5.0.1), can you reinstall bleach and check again?
I encountered the same error. I have all the latest packages in the requirement.txt
@mso1830 I pushed a fix to the main branch, not yet on pypi. Can you try it if it works for you?