This repository has been archived on 2023-05-17. You can view files and clone it, but cannot push or open issues/pull-requests.
Go to file
0xMRTT 9f04710faf doc: add deprecation notice 2023-05-17 14:49:40 +00:00
docs doc: add mkdocs 2023-04-30 01:49:38 +02:00
hgchat fix: json decode error 2023-05-06 19:20:49 +02:00
tests misc: add git and poetry 2023-04-29 13:50:53 +02:00
.gitignore misc: add git and poetry 2023-04-29 13:50:53 +02:00
README.md doc: add deprecation notice 2023-05-17 14:49:40 +00:00
chat.py chat: add chat 2023-04-29 13:50:46 +02:00
mkdocs.yml doc: add mkdocs 2023-04-30 01:49:38 +02:00
poetry.lock hgchat: fix modal error 2023-05-05 22:07:08 +02:00
pyproject.toml bump: 0.1.3 2023-05-06 19:21:00 +02:00

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