Skip to content

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

@GenTxt

Description

@GenTxt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions