Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add readlines() option to Demo.py? #2

Open
GenTxt opened this issue Nov 8, 2022 · 0 comments
Open

How to add readlines() option to Demo.py? #2

GenTxt opened this issue Nov 8, 2022 · 0 comments

Comments

@GenTxt
Copy link

GenTxt commented Nov 8, 2022

Script working with latest koboldai 1.19.1 and ubuntu 18.04 under python3.8.

It's great having python access to koboldai without having to write lua userscripts.

Attempting to edit 'Demo.py' so that a text file can be read line-by-line as prompts instead of pasting each prompt to koboldai gui.

New to python and not sure how to add this code snippet or something similar:

file = open("test_prompts.txt", "r")
Lines = file.readlines()
file.close()

for line in Lines:
sentence = f'{line.strip()}'

Assume it would be added here under # Handle Special Commands?

# Take Input
textin = input("[Input " + str(controller.inputs+1) + "]\nInput: ")

# Handle Special Commands

etc.

Would appreciate help in this matter.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant