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

Bavarder/hgchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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