Code Monkey home page Code Monkey logo

discordmessages-ai's Introduction

  • ๐Ÿ‘‹ Hi! Iโ€™m Rian, a second year CS student
  • ๐Ÿ‘€ Iโ€™m interested in web development, software engineering and machine learning
  • ๐ŸŒฑ Iโ€™m currently learning C++ and JavaScript

discordmessages-ai's People

Contributors

rian-kh avatar

Watchers

 avatar

discordmessages-ai's Issues

MAJOR: Program does not run scripts after compiling

The compiled program using PyInstaller can't use the subprocess.Popen("python script.py") because the python interpreter isn't included. It can however use exec() but this leads to issues with how to save/terminate it, and subprocess doesn't seem to be usuable to call only functions like exec() (..?).

Tried switching from using subprocess to multiprocessing (branch: multiprocess):

  • Program can run the script, but there's no way to terminate it because the process variable (p) can't be referenced outside of runTraining() (p is not defined)

What should happen:

  1. Pressing "Start training" starts a thread that runs the process of running trainGPT2.py through exec(). (Works)
  2. Pressing "Save and end training" sends a SIGINT signal to the process, forcing it to save. (Doesn't work)

MAJOR: Scripts do not output all of the text when ran from console, rather than IDE

All of the training step output and the text generation output is missing when ran from a console/terminal using the "python" command.

image

Probably has to do with these tasks being separate python processes (?) that print to themselves rather than the main GUI python process.

Fixing this would make it so that you can run main.py from console, instead of having to set up an IDE.

Combine "Save training" and "End training" into one button

Main problem is figuring out how to terminate RIGHT AFTER saving.

In this code for a combined "End training" button:

if event == 'End training' and trainingStarted:
    p.send_signal(signal.SIGINT)
    p.terminate()
    trainingStarted = False

Because it's a threaded task (?) it will try saving, but immediately exit before it can fully save.
Sending the SIGINT (needed for it to save) only interrupts the process but does not stop it from running in the background, so the terminate is necessary.

Disable user input in output box

Adding the line:

window.find_element('_output_').Update(disabled=True)

to the event loop hangs the program once closed with training/generation running.

When adding this line, the output box can be typed in when the program is first started but is disabled as it should be once a button is pressed.

Model deletion not allowed after natural exit of training/text generation

Mainly because model deletion relies on booleans updated when pressing their respective "End" buttons, but in the case where the program exits by itself (steps reached, samples finished) the boolean is not updated.

  • Could use thread/genThread.wait(), but this would result in the program hanging until finished...

Prevent closing program while training is running

Editing the close event:

    if event in (None, "Exit"):

        if trainingStarted:
            sg.popup("Please save and end training before quitting the program.")
            window.refresh()
        else:
            if generationStarted:
                q.terminate()

            exit()
            break

makes it so the popup shows once the app is closed, but the program still exits regardless.

Add input checking for valid values

ex. No strings in argument textboxes needing integers, like Steps

Main problem:

  • Adding an 'if' block to check if a parameter's input is valid ONLY gets ran if a button is pressed, not if the user is done entering text.

In order, what should happen is:

  1. User enters invalid text
  2. Once clicking away, a popup says to check again that text is valid
  3. Parameter is updated back to default value

MAJOR - Windows: SIGINT and terminate() can't be used to interrupt training/generation

Error message when pressing "Save and end training":

Traceback (most recent call last):
File "C:\Users\Rian\PycharmProjects\DiscordMessages-AI\main.py", line 218, in
p.send_signal(signal.SIGINT)
File "C:\Users\Rian\miniconda3\envs\tf\lib\subprocess.py", line 1545, in send_signal
raise ValueError("Unsupported signal: {}".format(sig))
ValueError: Unsupported signal: 2

When pressing "End text generation", no error is thrown but the generation still continues.

Fix weird output box updating

  • Make it so only certain buttons (Start/End training, Start/End generation) clear the output box rather than every button.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.