Instructions to use Syigen/rgcm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Syigen/rgcm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Syigen/rgcm")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Syigen/rgcm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download concept_memory/types.py from Syigen/rgcm: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/Syigen/rgcm/resolve/main/concept_memory/types.py
- Command line
-
hf download hf://Syigen/rgcm/concept_memory/types.py
-
curl -L -o types.py https://huggingface.co/Syigen/rgcm/resolve/main/concept_memory/types.py
1.25 kB
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Literal, TypeAlias | |
| from torch import Tensor | |
| QuestionType: TypeAlias = Literal["choice", "score", "noul"] | |
| class Criterion: | |
| id: str | |
| description: str | |
| class Question: | |
| id: str | |
| type: QuestionType | |
| instructions: str | |
| criteria: list[Criterion | str | dict[str, str]] = field(default_factory=list) | |
| def normalized_criteria(self) -> list[Criterion]: | |
| result: list[Criterion] = [] | |
| for index, item in enumerate(self.criteria): | |
| if isinstance(item, Criterion): | |
| result.append(item) | |
| elif isinstance(item, str): | |
| result.append(Criterion(str(index), item)) | |
| else: | |
| result.append(Criterion(item.get("id", str(index)), item["description"])) | |
| if self.type in ("choice", "score") and not result: | |
| raise ValueError(f"Question {self.id!r} of type {self.type!r} needs criteria") | |
| return result | |
| class TaskOutput: | |
| question_id: str | |
| type: QuestionType | |
| logits: object | |
| probabilities: Tensor | |
| prediction: object | |
| expected_score: object | None = None | |