Download __init__.py from TanujInsane/document-classification-env: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/TanujInsane/document-classification-env/resolve/main/__init__.py
- Command line
-
hf download hf://spaces/TanujInsane/document-classification-env/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/TanujInsane/document-classification-env/resolve/main/__init__.py
1.13 kB
| """ | |
| Document Classification Environment — OpenEnv-compliant package. | |
| Install: | |
| pip install git+https://huggingface.co/spaces/TanujInsane/document-classification-env | |
| Usage (sync): | |
| from document_classification_env import DocEnv, DocAction | |
| with DocEnv(base_url="https://tanujinsane-document-classification-env.hf.space").sync() as env: | |
| result = env.reset() | |
| result = env.step(DocAction(action_id=0, difficulty="easy")) | |
| print(result.observation.content[:120]) | |
| print("reward:", result.reward, "done:", result.done) | |
| Usage (async): | |
| import asyncio | |
| from document_classification_env import DocEnv, DocAction | |
| async def main(): | |
| async with DocEnv(base_url="https://tanujinsane-document-classification-env.hf.space") as env: | |
| result = await env.reset() | |
| result = await env.step(DocAction(action_id=0, difficulty="easy")) | |
| print(result.observation.content[:120]) | |
| asyncio.run(main()) | |
| """ | |
| from .client import DocEnv | |
| from .models import DocAction, DocObservation, DocState | |
| __all__ = ["DocEnv", "DocAction", "DocObservation", "DocState"] | |