Text Classification
Transformers
Safetensors
yield-weather-soil
crop-yield
multi-temporal
regression
yield-estimation
custom_code
Instructions to use ICICLE-AI/yield-estimation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ICICLE-AI/yield-estimation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ICICLE-AI/yield-estimation", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("ICICLE-AI/yield-estimation", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Delete processing_yield.py
Browse files- processing_yield.py +0 -37
processing_yield.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
# processing_yield.py
|
| 2 |
-
|
| 3 |
-
import json
|
| 4 |
-
from transformers.processing_utils import ProcessorMixin
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
class YieldProcessor(ProcessorMixin):
|
| 8 |
-
attributes = []
|
| 9 |
-
valid_kwargs = []
|
| 10 |
-
|
| 11 |
-
def __init__(self, **kwargs):
|
| 12 |
-
super().__init__()
|
| 13 |
-
|
| 14 |
-
def __call__(self, inputs=None, **kwargs):
|
| 15 |
-
"""
|
| 16 |
-
Accept either:
|
| 17 |
-
1. the existing dictionary input, or
|
| 18 |
-
2. a JSON string containing that dictionary.
|
| 19 |
-
"""
|
| 20 |
-
if inputs is None:
|
| 21 |
-
inputs = kwargs
|
| 22 |
-
|
| 23 |
-
if isinstance(inputs, str):
|
| 24 |
-
try:
|
| 25 |
-
inputs = json.loads(inputs)
|
| 26 |
-
except json.JSONDecodeError as e:
|
| 27 |
-
raise ValueError(
|
| 28 |
-
"YieldProcessor expected a JSON string "
|
| 29 |
-
"representing the model input."
|
| 30 |
-
) from e
|
| 31 |
-
|
| 32 |
-
if not isinstance(inputs, dict):
|
| 33 |
-
raise ValueError(
|
| 34 |
-
"YieldProcessor expects a dictionary or JSON string."
|
| 35 |
-
)
|
| 36 |
-
|
| 37 |
-
return inputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|