Spaces:
Sleeping
Sleeping
File size: 630 Bytes
fd5011f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import pickle
from datasets import load_dataset
from zeno import (
DistillReturn,
MetricReturn,
ModelReturn,
ZenoOptions,
distill,
metric,
model,
)
@model
def get_model(model_name):
def pred(df, ops: ZenoOptions):
res = []
#print(df)
#print(ops)
for data_columns in df[ops.data_column]:
## return where the data column exist in the dataframe column Question by the index
df_index = df[df["Question"] == data_columns].index[0]
res.append(df["Answering"][df_index])
return ModelReturn(model_output=res)
return pred |