Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (34 loc) · 815 Bytes

README.md

File metadata and controls

50 lines (34 loc) · 815 Bytes

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