Skip to content

Commit fe349ef

Browse files
Merge pull request #77 from innightwolfsleep/innightwolfsleep-patch-1
Innightwolfsleep patch 1
2 parents fac358f + 87a2f87 commit fe349ef

File tree

2 files changed

+93
-58
lines changed

2 files changed

+93
-58
lines changed

.github/workflows/python-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

readme.md

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
![Image1](https://github.com/innightwolfsleep/storage/raw/main/textgen_telegram.PNG)
33

4-
Providing chat like telegram bot interface for [abetlen/llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [huggingface/transformers](https://github.com/huggingface/transformers).
5-
In addition, can an extension for [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui).
4+
An extension for [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui).
5+
6+
In addition, can work as standalone app.
7+
68

79
---------------
810
HOW TO INSTALL (**standalone app**):
@@ -17,22 +19,7 @@ HOW TO RUN (**standalone app**):
1719
3) move your model file to `models/`
1820
4) set **model_path** to your model in `configs/app_config.json`
1921
5) start `run.cmd`(windows) or `run.sh`(linux)
20-
---------------
21-
HOW TO INSTALL (**extension mode**):
22-
23-
1) obviously, install [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) first, add model, set all options you need
24-
2) run `cmd_windows.bat` or `cmd_linux.sh` to enable venv
25-
3) clone this repo to "text-generation-webui\extensions"
26-
`git clone https://github.com/innightwolfsleep/text-generation-webui-telegram_bot text-generation-webui\extensions\telegram_bot`
27-
4) install requirements
28-
`pip install -r text-generation-webui\extensions\telegram_bot\ext_requirements_ext.txt`
29-
30-
HOW TO USE (**extension mode**):
31-
1) get bot token from https://t.me/BotFather
32-
2) add your bot token in `text-generation-webui\extensions\telegram_bot\configs\telegram_token.txt` file or oobabooga environment
33-
3) run server.py with `--extensions telegram_bot`
34-
4) (optional) if you are facing internet issue, change `proxy_url` at `extension_config.json` into your own proxy. For example: `https://127.0.0.1:10808`
35-
---------------
22+
6) ---------------
3623

3724
FEATURES:
3825
- chat and notebook modes
@@ -42,7 +29,7 @@ FEATURES:
4229
- buttons: continue previous message, regenerate last message, remove last messages from history, reset history button, new char loading menu
4330
- you can load new characters from text-generation-webui\characters with button
4431
- you can load new model during conversation with button
45-
- chatting "+" or "#" prefix for impersonate: "#Hero sister" or "+Castle guard". Or even ask bot generate your own message "+You"
32+
- "+" or "#" user message prefix for impersonate: "#Chiharu sister" or "+Castle guard". Or even ask bot generate your own message "+You"
4633
- "-" or "!" prefix to replace last bot message
4734
- "++" prefix replace bot name during chat (switch conversation to another character)
4835
- "--" prefix replace you name during chat
@@ -58,8 +45,8 @@ FEATURES:
5845

5946
CONFIGURATION:
6047

61-
`run_config.json` - config for running as standalone app (`run.sh` or `run.cmd`)
62-
`extension_config` - config for running as extension for [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui)
48+
`app_config.json` - config for running as standalone app (`run.sh` or `run.cmd`)
49+
`ext_config.json` - config for running as extension for [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui)
6350

6451
```
6552
x_config.json
@@ -80,50 +67,59 @@ x_config.json
8067
- generator_text_generator_webui_api - use oobabooga/text-generation-webui API extension
8168
model_path=models\llama-13b.ggml.q4_0.bin
8269
path to model .bin file
83-
characters_dir_path=characters
84-
default_char=Example.yaml
85-
default cahracter and path to cahracters folder
86-
presets_dir_path=presets
87-
default_preset=Shortwave.yaml
88-
default generation preset and path to preset folder
89-
model_lang=en
90-
user_lang=en
91-
default model and user language. User language can be switched by users, individualy.
92-
html_tag_open=<pre>
93-
html_tag_close=</pre>
94-
tags for bot answers in tg. By default - preformatted text (pre)
95-
history_dir_path=history
96-
directory for users history
97-
token_file_path=configs\\telegram_token.txt
98-
bot token. Ask https://t.me/BotFather
99-
admins_file_path=configs\\telegram_admins.txt
100-
users whos id's in admins_file switched to admin mode and can choose settings-for-all (generating settings and model)
101-
users_file_path=configs\\telegram_users.txt
102-
if just one id in users_file - bot will ignore all users except this id (id's). Even admin will be ignored
103-
generator_params_file_path=configs\\telegram_generator_params.json
104-
default text generation params, overwrites by choosen preset
105-
user_rules_file_path=configs\\telegram_user_rules.json
106-
user rules matrix
107-
telegram_sd_config=configs\\telegram_sd_config.json
108-
stable diffusion api config
109-
stopping_strings=<END>,<START>,end{code}
110-
eos_token=None
111-
generating settings
112-
translation_as_hidden_text=on
113-
if "on" and model/user lang not the same - translation will be writed under spoiler. If "off" - translation without spoiler, no original text in message.
70+
characters_dir_path=characters
71+
default_char=Example.yaml
72+
default cahracter and path to cahracters folder
73+
presets_dir_path=presets
74+
default_preset=Shortwave.yaml
75+
default generation preset and path to preset folder
76+
model_lang=en
77+
user_lang=en
78+
default model and user language. User language can be switched by users, individualy.
79+
html_tag_open=<pre>
80+
html_tag_close=</pre>
81+
tags for bot answers in tg. By default - preformatted text (pre)
82+
history_dir_path=history
83+
directory for users history
84+
token_file_path=configs\\telegram_token.txt
85+
bot token. Ask https://t.me/BotFather
86+
admins_file_path=configs\\telegram_admins.txt
87+
users whos id's in admins_file switched to admin mode and can choose settings-for-all (generating settings and model)
88+
users_file_path=configs\\telegram_users.txt
89+
if just one id in users_file - bot will ignore all users except this id (id's). Even admin will be ignored
90+
generator_params_file_path=configs\\telegram_generator_params.json
91+
default text generation params, overwrites by choosen preset
92+
user_rules_file_path=configs\\telegram_user_rules.json
93+
user rules matrix
94+
telegram_sd_config=configs\\telegram_sd_config.json
95+
stable diffusion api config
96+
stopping_strings=<END>,<START>,end{code}
97+
eos_token=None
98+
generating settings
99+
translation_as_hidden_text=on
100+
if "on" and model/user lang not the same - translation will be writed under spoiler. If "off" - translation without spoiler, no original text in message.
114101
sd_api_url="http://127.0.0.1:7860"
115-
stable diffusion api url, need to use "photo" prefixes
116-
proxy_url
117-
to avoid provider blocking
102+
stable diffusion api url, need to use "photo" prefixes
103+
proxy_url
104+
to avoid provider blocking
105+
118106
107+
telegram_generator_params.json
108+
config for generator
109+
110+
telegram_sd_config.json
111+
config for stable diffusion
119112
120113
telegram_admins.txt
121-
list of users id who forced to admin mode.
114+
list of users id who forced to admin mode. If telegram_users not empty - must be in telegram_users too!
122115
123116
telegram_users.txt
124-
list og users id (or groups id) who permitted interact with bot. If empty - everyone permitted
117+
list og users id (or groups id) who permitted interact with bot. If empty - everyone permitted
125118
126119
telegram_token.txt
127-
telegram bot token
120+
telegram bot token
121+
122+
telegram_user_rules.json
123+
buttons visibility config for various bot modes
128124
129125
```

0 commit comments

Comments
 (0)