🤗 Transformers Agent UI
THIS PROJECT IS CURRENTLY A PROOF OF CONCEPT. DON'T EXPECT EVERYTHING TO WORK! CHECK OUT THE TODO LIST FOR MORE INFO.
We want to
- Make it easy to use the Hugging Face Transformers Agent.
We provide
- the
TransformersAgentUIcomponent which can be used in the notebook as a web app - a deployment of the web app on Hugging Face Spaces
You can install and use the package as simple as.
pip install transformers-agent-ui
In a notebook just run
import panel as pn
from transformers_agent_ui import TransformersAgentUI
pn.extension("terminal", "notifications", notifications=True, design="bootstrap")
TransformersAgentUI()
To serve as a web app create the file app.py
import panel as pn
from transformers_agent_ui import TransformersAgentUI
if pn.state.served:
pn.extension("terminal", "notifications", notifications=True, design="bootstrap")
TransformersAgentUI().servable()
and run
BOKEH_RESOURCES=cdn panel serve app.py
'
In order for you to run the inference you will have to provide tokens. Preferably via the environment variables
HUGGING_FACE_TOKENOPEN_AI_TOKEN
Alternatively you can provide them on the Settings tab in the app.
🚀 Get started in under a minute
Install transformers-agent-ui including the examples dependencies.
pip install transformers-agent-ui[examples]
Explore the sample apps
pn hello transformers-agent-ui
You can now find the reference and gallery notebooks in the examples/awesome-panel/transformers-agent-ui folder. Check them out by running jupyter lab.
📒 Explore the examples online
Click one of the buttons
⭐ Support
Please support Panel and awesome-panel by giving the projects a star on Github:
Thanks
❤️ Contribute
If you are looking to contribute to this project you can find ideas in the issue tracker. To get started check out the DEVELOPER_GUIDE.
I would love to support and receive your contributions. Thanks.
Monitor
Todo List
- Implement TokenManager
- Save every run - also when cache is hit
- Add notification if no token is available
- Deploy to Pypi. DONE - See link
- Rename
runningparameter tois_runningparameter - Move use_cache from settings tab to editor tab
- Save run prints to store
- Redirect log to Terminal AND to stdout for easier debugging
- Support dynamic arguments (text, image etc) to run function
- As inputs to .run
- Create/ Update from file
- Create/ Update from output
- Delete/ Remove
- Get better feedback on run exceptions back
- Test it on lots of examples
- Add specific support for reading and writing more types. Currently most things are pickled.
- torch.Tensor is often returned and can be saved
- Add specific support for reading and writing more types. Currently most things are pickled.
- Add three examples to make it easy to get started
- Support enabled
remoteparameter setting. Currently we only supportremote. - Don't save asset if from cache. Instead reuse.
- Make the Cache/ Store useful by providing an interface
- Multi user support
- Restrict logs to user session
- See also hf #23354
- Restrict store to user session
- Make application non-blocking when used by multiple users
- Restrict logs to user session
- Deploy to Hugging Face. I probably wont be able to as the app needs a lot of power when running locally.
- Build a sample store and collect data on runs
- Enable downloading the output value
- Help the app and/ or Panel display the outputs. For example when a tensor is returned Panel
- Specifically test that the output of each tool is supported does not know how to display that. And the agent fails if we ask it to return the value wrapped in a HoloViz Panel Audio Pane. See Panel #4836
- Profile the
runand figure out if for example agents should be reused/ cached - Prompt seems to be cut of when displayed in the UI. Fix this
Maybe later list
- Make the project more specific by calling it hfagent-ui and providing HFAgentUI,
- Make the project more general as in agent-ui. We could provide HFAgentUI, LangChainAgentUI etc. Or maybe even just AgentUI. Much of the code would be reusable.
- Run inference async to make app more performant if possible
- Support chat mode.
Metadata
Release files for transformers-agent-ui 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transformers-agent-ui-0.4.1.tar.gz | 963.4 kB | Without provenance | Details for transformers-agent-ui-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transformers_agent_ui-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for transformers_agent_ui-0.4.1-py3-none-any.whl |
Total release size: 1.9 MB
Release files / transformers-agent-ui-0.4.1.tar.gz
| Download URL | transformers-agent-ui-0.4.1.tar.gz |
|---|---|
| Size | 963.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afda58f954ce8dafaae9936124b5ddd3f6d6dccb09af547b4b8b553034b10280
|
|
BLAKE2b-256 checksum How to use checksums |
bfbbcb6fa72ebc77287441603b4e1eccc57d5a1ba74e7a4d16b5122c5ab0213d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / transformers_agent_ui-0.4.1-py3-none-any.whl
| Download URL | transformers_agent_ui-0.4.1-py3-none-any.whl |
|---|---|
| Size | 961.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b5f450b268330f036acd0cf8477c96faeedcfa3c0fa99e986cac01ea7ef36b0
|
|
BLAKE2b-256 checksum How to use checksums |
0fead4989227d1d52bfee4d1f0fb42e826100efb8bc571af06fa6ac96316cf6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for transformers-agent-ui 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.