Instructions to use realitisoft/ai-bot-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use realitisoft/ai-bot-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="realitisoft/ai-bot-test")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("realitisoft/ai-bot-test") model = AutoModelForSpeechSeq2Seq.from_pretrained("realitisoft/ai-bot-test", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download venv/lib/python3.11/site-packages/prompt_toolkit/clipboard/base.py from realitisoft/ai-bot-test: direct link, hf CLI and curl.
- Browser
- Download file 2.52 kB
-
https://huggingface.co/realitisoft/ai-bot-test/resolve/main/venv/lib/python3.11/site-packages/prompt_toolkit/clipboard/base.py
- Command line
-
hf download hf://realitisoft/ai-bot-test/venv/lib/python3.11/site-packages/prompt_toolkit/clipboard/base.py
-
curl -L -o base.py https://huggingface.co/realitisoft/ai-bot-test/resolve/main/venv/lib/python3.11/site-packages/prompt_toolkit/clipboard/base.py
2.52 kB
| """ | |
| Clipboard for command line interface. | |
| """ | |
| from __future__ import annotations | |
| from abc import ABCMeta, abstractmethod | |
| from typing import Callable | |
| from prompt_toolkit.selection import SelectionType | |
| __all__ = [ | |
| "Clipboard", | |
| "ClipboardData", | |
| "DummyClipboard", | |
| "DynamicClipboard", | |
| ] | |
| class ClipboardData: | |
| """ | |
| Text on the clipboard. | |
| :param text: string | |
| :param type: :class:`~prompt_toolkit.selection.SelectionType` | |
| """ | |
| def __init__( | |
| self, text: str = "", type: SelectionType = SelectionType.CHARACTERS | |
| ) -> None: | |
| self.text = text | |
| self.type = type | |
| class Clipboard(metaclass=ABCMeta): | |
| """ | |
| Abstract baseclass for clipboards. | |
| (An implementation can be in memory, it can share the X11 or Windows | |
| keyboard, or can be persistent.) | |
| """ | |
| def set_data(self, data: ClipboardData) -> None: | |
| """ | |
| Set data to the clipboard. | |
| :param data: :class:`~.ClipboardData` instance. | |
| """ | |
| def set_text(self, text: str) -> None: # Not abstract. | |
| """ | |
| Shortcut for setting plain text on clipboard. | |
| """ | |
| self.set_data(ClipboardData(text)) | |
| def rotate(self) -> None: | |
| """ | |
| For Emacs mode, rotate the kill ring. | |
| """ | |
| def get_data(self) -> ClipboardData: | |
| """ | |
| Return clipboard data. | |
| """ | |
| class DummyClipboard(Clipboard): | |
| """ | |
| Clipboard implementation that doesn't remember anything. | |
| """ | |
| def set_data(self, data: ClipboardData) -> None: | |
| pass | |
| def set_text(self, text: str) -> None: | |
| pass | |
| def rotate(self) -> None: | |
| pass | |
| def get_data(self) -> ClipboardData: | |
| return ClipboardData() | |
| class DynamicClipboard(Clipboard): | |
| """ | |
| Clipboard class that can dynamically returns any Clipboard. | |
| :param get_clipboard: Callable that returns a :class:`.Clipboard` instance. | |
| """ | |
| def __init__(self, get_clipboard: Callable[[], Clipboard | None]) -> None: | |
| self.get_clipboard = get_clipboard | |
| def _clipboard(self) -> Clipboard: | |
| return self.get_clipboard() or DummyClipboard() | |
| def set_data(self, data: ClipboardData) -> None: | |
| self._clipboard().set_data(data) | |
| def set_text(self, text: str) -> None: | |
| self._clipboard().set_text(text) | |
| def rotate(self) -> None: | |
| self._clipboard().rotate() | |
| def get_data(self) -> ClipboardData: | |
| return self._clipboard().get_data() | |