(model_path)
| 205 | |
| 206 | |
| 207 | def get_model_name_from_path(model_path): |
| 208 | model_path = model_path.strip("/") |
| 209 | model_paths = model_path.split("/") |
| 210 | if model_paths[-1].startswith('checkpoint-'): |
| 211 | return model_paths[-2] + "_" + model_paths[-1] |
| 212 | else: |
| 213 | return model_paths[-1] |
| 214 | |
| 215 | class KeywordsStoppingCriteria(StoppingCriteria): |
| 216 | def __init__(self, keywords, tokenizer, input_ids): |
no outgoing calls
no test coverage detected