transformers-agent-ui


Nametransformers-agent-ui JSON
Version 0.4.0 PyPI version JSON
download
home_page
SummaryThis package makes it super simple to do exploratory data analysis and develop high-quality Panel data apps ...
upload_time2023-05-14 18:59:54
maintainer
docs_urlNone
authorawesome-panel
requires_python>=3.7
license
keywords python huggingface transformers deeplearning ai agent holoviz panel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🤗 Transformers Agent UI

THIS PROJECT IS CURRENTLY A PROOF OF CONCEPT. DON'T EXPECT EVERYTHING TO WORK! CHECK OUT THE
[TODO LIST](#todo-list) FOR MORE INFO.

We want to

- Make it easy to use the [Hugging Face Transformers Agent](https://huggingface.co/docs/transformers/transformers_agents).

We provide

- the `TransformersAgentUI` component 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.

```bash
pip install transformers-agent-ui
```

In a notebook just run

```python
import panel as pn
from transformers_agent_ui import TransformersAgentUI

pn.extension("terminal", "notifications", notifications=True, design="bootstrap")

TransformersAgentUI()
```

![TransformerAgentUI in a notebook](assets/transformers-agent-ui-notebook.png)

To serve as a web app create the file `app.py`

```python
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

```bash
BOKEH_RESOURCES=cdn panel serve app.py
```

'
![TransformerAgentUI on a server](assets/transformers-agent-ui-web-app.png)

In order for you to run the inference you will have to provide tokens. Preferably via the
environment variables

- `HUGGING_FACE_TOKEN`
- `OPEN_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*.

```bash
pip install  transformers-agent-ui[examples]
```

Explore the sample apps

```bash
pn hello transformers-agent-ui
```

<!-- ![Project Intro](https://raw.githubusercontent.com/awesome-panel/transformers-agent-ui/main/assets/videos/pn-hello-transformers-agent-ui.gif) -->

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

[![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/awesome-panel/transformers-agent-ui/tree/main/examples/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/awesome-panel/transformers-agent-ui/HEAD)

## ⭐ Support

Please support [Panel](https://panel.holoviz.org) and
[awesome-panel](https://awesome-panel.org) by giving the projects a star on Github:

- [holoviz/panel](https://github.com/holoviz/panel).
- [awesome-panel/awesome-panel](https://github.com/awesome-panel/awesome-panel).

Thanks

## ❤️ Contribute

If you are looking to contribute to this project you can find ideas in the [issue tracker](https://github.com/awesome-panel/transformers-agent-ui/issues). To get started check out the [DEVELOPER_GUIDE](DEVELOPER_GUIDE.md).

I would love to support and receive your contributions. Thanks.

[![Hacktober Fest](https://github.blog/wp-content/uploads/2022/10/hacktoberfestbanner.jpeg?fit=1200%2C630)](https://github.com/awesome-panel/transformers-agent-ui/issues).

## Monitor

[![PyPI version](https://badge.fury.io/py/transformers-agent-ui.svg)](https://pypi.org/project/transformers-agent-ui/)
[![Downloads](https://pepy.tech/badge/transformers-agent-ui/month)](https://pepy.tech/project/transformers-agent-ui)
![Python Versions](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)
[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/MIT)
![Test Results](https://github.com/awesome-panel/transformers-agent-ui/actions/workflows/tests.yaml/badge.svg?branch=main)

## Todo List

- [x] Implement TokenManager
- [x] Save every run - also when cache is hit
- [x] Add notification if no token is available
- [x] Deploy to Pypi. DONE - See [link](https://pypi.org/project/transformers-agent-ui/)
- [x] Rename `running` parameter to `is_running` parameter
- [x] Move use_cache from settings tab to editor tab
- [x] Save run prints to store
- [ ] Redirect log to Terminal AND to stdout for easier debugging
- [ ] Support dynamic arguments (text, image etc) to run function
  - [x] 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 three examples to make it easy to get started
- [ ] Support enabled `remote` parameter setting. Currently we only support `remote`.
- [ ] 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](https://github.com/huggingface/transformers/issues/23354)
  - [ ] Restrict store to user session
  - [ ] Make application non-blocking when used by multiple users
- [ ] 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](https://github.com/holoviz/panel/issues/4836)
- [ ] Profile the `run` and 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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "transformers-agent-ui",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "python,huggingface,transformers,deeplearning,ai,agent,holoviz,panel",
    "author": "awesome-panel",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/6e/19/50169eca2c8a944e7776664a8dfbec69a8b08a2692c6b39b3dabd69361ea/transformers-agent-ui-0.4.0.tar.gz",
    "platform": null,
    "description": "# \ud83e\udd17 Transformers Agent UI\n\nTHIS PROJECT IS CURRENTLY A PROOF OF CONCEPT. DON'T EXPECT EVERYTHING TO WORK! CHECK OUT THE\n[TODO LIST](#todo-list) FOR MORE INFO.\n\nWe want to\n\n- Make it easy to use the [Hugging Face Transformers Agent](https://huggingface.co/docs/transformers/transformers_agents).\n\nWe provide\n\n- the `TransformersAgentUI` component which can be used in the notebook as a web app\n- a deployment of the web app on Hugging Face Spaces\n\nYou can install and use the package as simple as.\n\n```bash\npip install transformers-agent-ui\n```\n\nIn a notebook just run\n\n```python\nimport panel as pn\nfrom transformers_agent_ui import TransformersAgentUI\n\npn.extension(\"terminal\", \"notifications\", notifications=True, design=\"bootstrap\")\n\nTransformersAgentUI()\n```\n\n![TransformerAgentUI in a notebook](assets/transformers-agent-ui-notebook.png)\n\nTo serve as a web app create the file `app.py`\n\n```python\nimport panel as pn\nfrom transformers_agent_ui import TransformersAgentUI\n\nif pn.state.served:\n    pn.extension(\"terminal\", \"notifications\", notifications=True, design=\"bootstrap\")\n    TransformersAgentUI().servable()\n```\n\nand run\n\n```bash\nBOKEH_RESOURCES=cdn panel serve app.py\n```\n\n'\n![TransformerAgentUI on a server](assets/transformers-agent-ui-web-app.png)\n\nIn order for you to run the inference you will have to provide tokens. Preferably via the\nenvironment variables\n\n- `HUGGING_FACE_TOKEN`\n- `OPEN_AI_TOKEN`\n\nAlternatively you can provide them on the *Settings tab* in the app.\n\n## \ud83d\ude80 Get started in under a minute\n\nInstall `transformers-agent-ui` including the *`examples` dependencies*.\n\n```bash\npip install  transformers-agent-ui[examples]\n```\n\nExplore the sample apps\n\n```bash\npn hello transformers-agent-ui\n```\n\n<!-- ![Project Intro](https://raw.githubusercontent.com/awesome-panel/transformers-agent-ui/main/assets/videos/pn-hello-transformers-agent-ui.gif) -->\n\nYou can now find the *reference* and *gallery* notebooks in the `examples/awesome-panel/transformers-agent-ui` folder. Check them out by running `jupyter lab`.\n\n## \ud83d\udcd2 Explore the examples online\n\nClick one of the buttons\n\n[![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/awesome-panel/transformers-agent-ui/tree/main/examples/)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/awesome-panel/transformers-agent-ui/HEAD)\n\n## \u2b50 Support\n\nPlease support [Panel](https://panel.holoviz.org) and\n[awesome-panel](https://awesome-panel.org) by giving the projects a star on Github:\n\n- [holoviz/panel](https://github.com/holoviz/panel).\n- [awesome-panel/awesome-panel](https://github.com/awesome-panel/awesome-panel).\n\nThanks\n\n## \u2764\ufe0f Contribute\n\nIf you are looking to contribute to this project you can find ideas in the [issue tracker](https://github.com/awesome-panel/transformers-agent-ui/issues). To get started check out the [DEVELOPER_GUIDE](DEVELOPER_GUIDE.md).\n\nI would love to support and receive your contributions. Thanks.\n\n[![Hacktober Fest](https://github.blog/wp-content/uploads/2022/10/hacktoberfestbanner.jpeg?fit=1200%2C630)](https://github.com/awesome-panel/transformers-agent-ui/issues).\n\n## Monitor\n\n[![PyPI version](https://badge.fury.io/py/transformers-agent-ui.svg)](https://pypi.org/project/transformers-agent-ui/)\n[![Downloads](https://pepy.tech/badge/transformers-agent-ui/month)](https://pepy.tech/project/transformers-agent-ui)\n![Python Versions](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)\n[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/MIT)\n![Test Results](https://github.com/awesome-panel/transformers-agent-ui/actions/workflows/tests.yaml/badge.svg?branch=main)\n\n## Todo List\n\n- [x] Implement TokenManager\n- [x] Save every run - also when cache is hit\n- [x] Add notification if no token is available\n- [x] Deploy to Pypi. DONE - See [link](https://pypi.org/project/transformers-agent-ui/)\n- [x] Rename `running` parameter to `is_running` parameter\n- [x] Move use_cache from settings tab to editor tab\n- [x] Save run prints to store\n- [ ] Redirect log to Terminal AND to stdout for easier debugging\n- [ ] Support dynamic arguments (text, image etc) to run function\n  - [x] As inputs to .run\n  - [ ] Create/ Update from file\n  - [ ] Create/ Update from output\n  - [ ] Delete/ Remove\n- [ ] Get better feedback on run exceptions back\n- [ ] Test it on lots of examples\n  - [ ] Add specific support for reading and writing more types. Currently most things are pickled.\n    - torch.Tensor is often returned and can be saved\n- [ ] Add three examples to make it easy to get started\n- [ ] Support enabled `remote` parameter setting. Currently we only support `remote`.\n- [ ] Don't save asset if from cache. Instead reuse.\n- [ ] Make the Cache/ Store useful by providing an interface\n- [ ] Multi user support\n  - [ ] Restrict logs to user session\n    - See also [hf #23354](https://github.com/huggingface/transformers/issues/23354)\n  - [ ] Restrict store to user session\n  - [ ] Make application non-blocking when used by multiple users\n- [ ] Deploy to Hugging Face. I probably wont be able to as the app needs a lot of power when\nrunning locally.\n- [ ] Build a sample store and collect data on runs\n- [ ] Enable downloading the output value\n- [ ] Help the app and/ or Panel display the outputs. For example when a tensor is returned Panel\n- [ ] Specifically test that the output of each tool is supported\ndoes not know how to display that. And the agent fails if we ask it to return the value wrapped in\na HoloViz Panel Audio Pane. See [Panel #4836](https://github.com/holoviz/panel/issues/4836)\n- [ ] Profile the `run` and figure out if for example agents should be reused/ cached\n- [ ] Prompt seems to be cut of when displayed in the UI. Fix this\n\n## Maybe later list\n\n- [ ] Make the project more specific by calling it hfagent-ui and providing HFAgentUI,\n- [ ] Make the project more general as in agent-ui. We could provide HFAgentUI,\nLangChainAgentUI etc. Or maybe even just AgentUI. Much of the code would be reusable.\n- [ ] Run inference async to make app more performant if possible\n- [ ] Support chat mode.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This package makes it super simple to do exploratory data analysis and develop high-quality Panel data apps ...",
    "version": "0.4.0",
    "project_urls": {
        "repository": "https://github.com/awesome-panel/transformers-agent-ui"
    },
    "split_keywords": [
        "python",
        "huggingface",
        "transformers",
        "deeplearning",
        "ai",
        "agent",
        "holoviz",
        "panel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69a568f5fe0c7f905db1a685508f40dbea418e70ae434c7f54def551a1d07415",
                "md5": "3a0585dc81ca388d8ccd4b194ebdc92f",
                "sha256": "6785fbf1f504414152361897ad44d2861df8bcdb9d69d78283a0fcc0deef67ff"
            },
            "downloads": -1,
            "filename": "transformers_agent_ui-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a0585dc81ca388d8ccd4b194ebdc92f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 961274,
            "upload_time": "2023-05-14T18:59:51",
            "upload_time_iso_8601": "2023-05-14T18:59:51.166472Z",
            "url": "https://files.pythonhosted.org/packages/69/a5/68f5fe0c7f905db1a685508f40dbea418e70ae434c7f54def551a1d07415/transformers_agent_ui-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e1950169eca2c8a944e7776664a8dfbec69a8b08a2692c6b39b3dabd69361ea",
                "md5": "2621a0e8796912220eab0c909cb46fd2",
                "sha256": "2c7d7010912c1d509a11521a9c37078695fbb2c02eecda7ee0b4a8cca32302bf"
            },
            "downloads": -1,
            "filename": "transformers-agent-ui-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2621a0e8796912220eab0c909cb46fd2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 963317,
            "upload_time": "2023-05-14T18:59:54",
            "upload_time_iso_8601": "2023-05-14T18:59:54.482467Z",
            "url": "https://files.pythonhosted.org/packages/6e/19/50169eca2c8a944e7776664a8dfbec69a8b08a2692c6b39b3dabd69361ea/transformers-agent-ui-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-14 18:59:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "awesome-panel",
    "github_project": "transformers-agent-ui",
    "github_not_found": true,
    "lcname": "transformers-agent-ui"
}
        
Elapsed time: 0.10889s