4 ms·
I fed it a small snippet of Python code, and I got this back (edited to fix syntax errors): import matplotlib.pyplot as plt ax = plt.Axes() ax.set_xlabe
by 1f60c 7y ago
I fed it a small snippet of Python code, and I got this back (edited to fix syntax errors):
import matplotlib.pyplot as plt
ax = plt.Axes()
ax.set_xlabel(name='Person ')
ax.set_ylabel(name='Name ')
plt.scatter([df.name, ax.x(1/2)).sum(), ax.y(1/2))
plt.col, ax.rect(name='Name')
ax.show()
It doesn't make total sense, but it's so cool to see that AI has seemingly learned to use the matplotlib API, save for some unbalanced parentheses :-)
- davidlee1435 7y agoI wonder if you could make an RL version of a GPT-2 model specifically optimized for code, where you try to compile the output and penalize whenever there is an exception/error that's thrown.
- intuitionist 7y agoIt seems pretty good at matching parens and braces for C code, although it decided it was finished before outputting the closing brace for the function (the prompt was just the signature): void send_file(int* fd) { int file_type; char *file_name; size_t name_len; FILE *fp; char *name = NULL; if(fmt::error_code != 0) return error("Could not set file type"); fp = &file->fp; size_t file_size = fprintf(fp, "%02x", fp->fname); if(fp->fname == fp->fname || _FTP_FILE_TYPE == 0) { fp->fp->fname = 0; // Do nothing for errors } /* Write some info to fp */ fp->fp->fd = calloc(1, fd) + (1 + file_size); fp->fp->sig = calloc(1, &file->sig); fp->fp->buf = (int *)((size_t)sizeof(*fp)); /* Make sure fp isn't open */ if(!fp->closed) { // Close fd with error() fp = new(FTP_FDCALLTYPE) void(1); fp->fdclose((void *)&fp); return; } fp->fp->buf_len = file_size; fp->fp->name = name; file_name = name; fp->fp->cwd = nullptr; /* Don't close fd after this point */ fp->fp->fdclose(fprintf(f, "fd open", TRUE)); Not too bad, but I'm not worried about losing my job to a language model anytime soon.
- kirkules 7y agoNot saying you should be worried, but this model is not the one that would be in the running for your job, in case that ever happened