chp-adapter-huggingface 0.11.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ node_modules/
2
+ dist/
3
+ .next/
4
+ out/
5
+ .turbo/
6
+ *.tsbuildinfo
7
+ .yalc/
8
+ yalc.lock
9
+ *.tgz
10
+ .env
11
+ .env.*
12
+ coverage/
13
+ dashboard/
14
+ components/
15
+ # ...but the cockpit's app source lives in app/components — never ignore real source.
16
+ !cockpit/app/components/
17
+ !cockpit/app/components/**
18
+ !chp-evidence/app/components/
19
+ !chp-evidence/app/components/**
20
+ .tech-hub-cache/
21
+ __pycache__/
22
+ *.py[cod]
23
+ .pytest_cache/
24
+ .chp/
25
+ .DS_Store
26
+ .coverage
27
+ .forge/
28
+ .hypothesis/
29
+ .claude/
30
+
31
+ # chp-agent evidence store
32
+ .chp-agent/sessions.sqlite
33
+ .publish-dist/
34
+
35
+ # matrix-bot runtime session registry (CC session ids)
36
+ matrix-bot/sessions.json
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: chp-adapter-huggingface
3
+ Version: 0.11.0
4
+ Summary: CHP adapter for local HuggingFace artifact consumption — pull, pipeline, embed, tokenize, dataset, cache
5
+ Keywords: capability-host-protocol,chp,huggingface,nlp,transformers
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: chp-core
8
+ Requires-Dist: datasets>=2.20
9
+ Requires-Dist: huggingface-hub>=0.24
10
+ Requires-Dist: tokenizers>=0.19
11
+ Requires-Dist: transformers>=4.40
12
+ Provides-Extra: lifecycle
13
+ Requires-Dist: evaluate>=0.4; extra == 'lifecycle'
14
+ Requires-Dist: gradio-client>=1.0; extra == 'lifecycle'
15
+ Requires-Dist: peft>=0.10; extra == 'lifecycle'
16
+ Provides-Extra: multimodal
17
+ Requires-Dist: diffusers>=0.30; extra == 'multimodal'
18
+ Requires-Dist: librosa>=0.10; extra == 'multimodal'
19
+ Requires-Dist: soundfile>=0.12; extra == 'multimodal'
20
+ Provides-Extra: torch
21
+ Requires-Dist: torch; extra == 'torch'
@@ -0,0 +1,37 @@
1
+ # chp-adapter-huggingface
2
+
3
+ Local consumption of HuggingFace Hub artifacts: pull models/datasets, run transformers pipelines, embed text, tokenize, and audit local cache.
4
+
5
+ ## Capabilities
6
+
7
+ | Capability | Risk | Description |
8
+ |---|---|---|
9
+ | `pull` | medium | Download any HuggingFace Hub artifact (model, dataset, tokenizer) to local cache via snapshot_download. |
10
+ | `run_pipeline` | medium | Run a transformers.pipeline() task on a locally-cached model. Inputs and outputs are never recorded in evidenc |
11
+ | `embed` | medium | Generate text embeddings using a locally-cached feature-extraction model. Vectors are returned but never store |
12
+ | `tokenize` | low | Encode text to token IDs or decode token IDs to text using a fast HuggingFace tokenizer. No full model load re |
13
+ | `load_dataset` | medium | Load rows from a HuggingFace dataset (Hub or local). Streaming=true reads without downloading the full dataset |
14
+ | `cache_info` | low | Scan the local HuggingFace cache and return a storage summary by artifact for governance and quota management. |
15
+ | `search_models` | low | Search HuggingFace Hub for models by task, sort, and filter. Enables agents to discover models programmaticall |
16
+ | `model_card` | low | Fetch structured model metadata from HuggingFace Hub: license, pipeline task, tags, gated status, author, and |
17
+ | `pull_for_local_llm` | medium | Pull GGUF model files from HuggingFace Hub and return the local path ready to pass directly to chp.adapters.lo |
18
+ | `search_datasets` | low | Search HuggingFace Hub for datasets by task, sort, and filter. Symmetric to search_models — enables agents to |
19
+ | `search_spaces` | low | Search HuggingFace Hub for Spaces (Gradio/Streamlit apps) by SDK, sort, and filter. Precondition for call_spac |
20
+ | `list_collections` | low | List HuggingFace Hub Collections — curated groupings of models and datasets. Enables agents to navigate themat |
21
+ | `dataset_preview` | low | Preview the schema and first N rows of a HuggingFace dataset via the Dataset Viewer API — no download required |
22
+ | `leaderboard_scores` | low | Fetch evaluation benchmark scores for a model from HuggingFace Hub (MMLU, ARC, TruthfulQA, etc.). Evidence-bac |
23
+ | `evaluate` | low | Compute evaluation metrics (BLEU, ROUGE, accuracy, F1, exact_match) against ground-truth references. Quality g |
24
+ | `apply_adapter` | medium | Download a LoRA/PEFT adapter from HuggingFace Hub and inspect its configuration. Returns the local adapter pat |
25
+ | `call_space` | medium | Invoke any HuggingFace Gradio Space as a governed CHP capability via gradio_client. Space ID, api_name, and la |
26
+ | `finetune` | high | Fine-tune a HuggingFace classification model locally using transformers.Trainer. Governance: model, dataset, h |
27
+ | `quantize_to_gguf` | medium | Convert a local HuggingFace model directory to quantized GGUF using llama.cpp tools. Two-step: convert_hf_to_g |
28
+ | `faiss_index` | low | Build or search a FAISS cosine-similarity index for RAG pipelines. 'build': creates IndexFlatIP from float emb |
29
+ | `transcribe_audio` | medium | Transcribe an audio file to text using a Whisper ASR pipeline. Input is a local file path (e.g. from the files |
30
+ | `classify_image` | low | Classify an image with a ViT/DeiT image-classification pipeline. Input is a local image path. Top-N labels and |
31
+ | `generate_image` | medium | Generate an image from a text prompt via a diffusers DiffusionPipeline (Stable Diffusion, etc.) and save it to |
32
+
33
+ ## Notes
34
+
35
+ Every capability is governed (risk-assessed via `safety.assess`) and evidenced (redacted: counts/ids, never payloads). Mutating ops may require approval.
36
+
37
+ _README generated deterministically from the adapter's `@capability` metadata (`stewards/gen_readme.py`); refine the prose as needed._
@@ -0,0 +1,3 @@
1
+ from .adapter import HuggingFaceAdapter, HuggingFaceConfig
2
+
3
+ __all__ = ["HuggingFaceAdapter", "HuggingFaceConfig"]