Remove dependency on torch for default installation

This commit is contained in:
dmahan93 2025-05-12 10:17:41 -05:00
parent 706097db21
commit 727c7ba640
5 changed files with 57 additions and 47 deletions

View file

@ -4,7 +4,17 @@ import logging
from typing import Any, List, Optional, Union
import scipy
import torch
try:
import torch
except ImportError as e:
logger = logging.getLogger(__name__)
logger.warning(
"torch not installed, please install atroposlib[rewardfns] to use this reward function"
)
raise e
from transformers import AutoModel, AutoTokenizer
from .registry import registry