josephrocca / OpenCharacters

Simple little web interface for creating characters and chatting with them. It's basically a single HTML file - no server. Share characters using a link (character data is stored within the URL itself). All chat data is stored in your browser using IndexedDB. Currently supports OpenAI APIs and ~any Hugging Face model.
https://josephrocca.github.io/OpenCharacters
MIT License
377 stars 66 forks source link

Safari iOS problems with Python Coder code execution? #41

Closed ketonatus closed 1 year ago

ketonatus commented 1 year ago

edit: tested in safari on iOS

Like this tool! But I want to run it on my iPhone and I suspect the code is not being executed when using the Python coder. I’ve also tried running in codespaces and seem to get similar results. Is there something I’m missing ?

This is the common answer: ‘’Sure! Here's an example Python code that creates a randomly initialized neural network with numpy, and prints the output given a random input:’’

it shows the code but no output or result. Or if I ask: please run the Python code in the last message:

‘’ I apologize, but as an AI language model, I do not have access to the Python environment to run the code. However, I can assure you that the code I provided should work as expected. If you encounter any errors, please let me know and I'd be happy to help you troubleshoot them.’’

josephrocca commented 1 year ago

Ah, thanks! It wasn't working on Desktop either - just fixed the bug that was causing this. Please refresh and try again. (try a simple example first like "write python code to print numbers 1-10 in a for loop" just to check that it's working)

ketonatus commented 1 year ago

I have to revert to this tree to get the code execution working again: https://github.com/josephrocca/OpenCharacters/tree/6fd5950b1f3d430490f30c6d90bbd1a2837b3506 the latest code on master is not working on iOS safari and keeps spinning and not answering my initial question.

josephrocca commented 1 year ago

Ah okay, strange. I don't have a Mac/iOS device, and I would recommend not touching Safari with a 10ft pole (as a dev or a user), but unfortunately Apple doesn't allow other browser engines on their devices (though EU and UK are about to force them to under anti-competition law), so even if you switch to Chrome/Firefox, it's actually just a skinned/themed version of Safari.

If you know how to open the devtools/debugger in the browser, and if you can paste any error messages here, I might be able to work out what's going on.

I've just tested on Chrome and Firefox (Android) and it works fine

ketonatus commented 1 year ago

It works in safari but I have to start the http-server with the argument —cors.

all good for Firefox and Brave also. My thought was safari had more capabilities but it was a test.