Hugging Chat in Python
https://bavarder.codeberg.page/code/hgchat/
|
||
---|---|---|
docs | ||
hgchat | ||
tests | ||
.gitignore | ||
README.md | ||
chat.py | ||
mkdocs.yml | ||
poetry.lock | ||
pyproject.toml |
README.md
Hugging Chat Python
Warn: This repo isn't maintained anymore. Use Soulter/hugging-chat-api instead.
Installation
As library
From Pypi
pip install hgchat
From Codeberg
pip install --index-url https://codeberg.org/api/packages/Bavarder/pypi/simple/ hgchat
As an interactive prompt
git clone https://codeberg.org/Bavarder/hgchat.git # or https://github.com/Bavarder/hgchat.git
cd hgchat
Usage
As library
from hgchat import HGChat
hgchat = HGChat()
r = hgchat.ask(user_input)
for i in r:
char = i["token"]["text"]
if char == "</s>":
print("\n", end="")
else:
print(char, end="")
As an interactive prompt
python chat.py