hyunwoongko / openchat

OpenChat: Easy to use opensource chatting framework via neural networks
Apache License 2.0
437 stars 57 forks source link

Unlikelyhood.ConvAi unavailable in pypi #40

Closed ilyalasy closed 3 years ago

ilyalasy commented 3 years ago

Hey, when trying to use any unlikelyhood.convaimodel there is an error:

Traceback (most recent call last):
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ilya/.vscode-server/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/home/ilya/.vscode-server/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/home/ilya/.vscode-server/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ilya/repos/openchat/chat.py", line 2, in <module>
    OpenChat(model="unlikelihood.convai2.vocab.alpha.1e-1", device="cpu")
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/site-packages/openchat/openchat.py", line 25, in __init__
    self.agent = self.create_agent_by_name(
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/site-packages/openchat/openchat.py", line 79, in create_agent_by_name
    return UnlikelihoodAgent(name, device, maxlen)
  File "/home/ilya/miniconda3/envs/oc/lib/python3.9/site-packages/openchat/agents/unlikelihood.py", line 53, in __init__
    option, model_class = self.set_options(
TypeError: set_options() missing 1 required positional argument: 'device'

I see that on github version this is fixed, but it's not when installing Openchat with pip install.

hyunwoongko commented 3 years ago

I solved the problem. Would you like to run the script below?

pip uninstall openchat
pip install openchat
ilyalasy commented 3 years ago

Yes, it's working now, thanks!