Open aaron-horowitz opened 1 year ago
Hm, have you set OPENAI_API_KEY
? And does the console print out any error messages?
Another possibility is a messed up python configuration, where running shiny
at the command line invokes a different copy of shiny (and python) than the one that's intended. I've had this happen personally, and I've helped a few people find and fix this.
If you modify the top of your app to have, the following, does it print out the values you expect?
import sys
import shiny
print("Python path: " + sys.executable)
print("Shiny version: " + shiny.__version__)
Coming back with what I'd expect:
Python path: /home/ahorowitz/.virtualenvs/venv_shinygpt/bin/python
Shiny version: 0.3.3
I've set the OPENAI_API_KEY
environment variable, and I've also tried it with specifying the key in the chatstream.chat_server
. Same result.
No error messages in the terminal.
This is what shows up in my developer console upon page load:
caught TypeError: Cannot read properties of null (reading 'style')
at <anonymous>:2:19
at <anonymous>:3:3
shiny-autoreload.ts:13 WebSocket connection to 'ws://127.0.0.1:32951/autoreload' failed:
(anonymous) @ shiny-autoreload.ts:13
(anonymous) @ shiny-autoreload.ts:18
DevTools failed to load source map: Could not load content for chrome-extension://liecbddmkiiihnedobmlmillhodjkdmb/js/companionBubble.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
I think the companionBubble.js.map
thing is from a browser extension.
And apologies if you did this, but I just want to make sure: Did you add those lines of code to the top of your app.py
and then run it with shiny run app.py
? (If you ran it from the python
console it could give different answers.)
Stepping back a bit, what do you get if you run:
which shiny
cat `which shiny`
And then it also makes sense to try creating and running a basic test app. Does the following work?
shiny create testapp
shiny run testapp/app.py
I ran it with the following command, in the terminal:
shiny run --reload --launch-browser --port=0 /home/ahorowitz/projects/py_shiny_gpt/examples/controls/app.py
which shiny
/home/ahorowitz/.virtualenvs/venv_shinygpt/bin/shiny
cat `which shiny`
#!/home/ahorowitz/.virtualenvs/venv_shinygpt/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from shiny._main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
Created and ran basic test app. Had to add --launch-browser, but then yep, it worked.
¯_(ツ)/¯ ¯_(ツ)/¯
Hi folks,
I just wanted to start messing around with this, and I get blank screens for the UI component of chatstream (the part I'm interested in, I could live with or without the python). I've tried to replicate both the
examples/basic/app.py
, which shows only a blank screen, and theexamples/controls/app.py
, which shows only the right side panel of controls.I downloaded via
pip install chatstream@git+https://github.com/wch/chatstream.git
into a virtual environment on Python 3.9.6, and worked with this on a Ubuntu 18.0 server.My python libraries in the virtual environment: