Views
No views yet
python repc.py --train --model_path teknium/OpenHermes-2.5-Mistral-7B --task tool --data_path data/data_within_tool_subset.json --n_train 5 --classifier svm --model_save_dir saved_models --use_cachemodel_path: Path to the pretrained language model.task: Which task to run.data_path: Path to the dataset containing tool descriptions and queries.n_train: Number of training examples for each class.classifier: Which classifier to use, only support svm currently.model_save_dir: Directory to save trained models.use_cache: Whether to use cached embeddings.python repc.py --evaluate --model_path teknium/OpenHermes-2.5-Mistral-7B --task tool --data_path data/data_within_tool_subset.json --n_train 5 --classifier svm --model_save_dir saved_models --use_cachemodel_path: Path to the pretrained language model.task: Which task to run.data_path: Path to the dataset containing tool descriptions and queries.n_train: Number of training examples for each class.classifier: Which classifier to use, only support svm currently.model_save_dir: Directory to save trained models.use_cache: Whether to use cached embeddings.python repc.py --zero_baseline --model_path teknium/OpenHermes-2.5-Mistral-7B --task tool --data_path data/data_within_tool_subset.json --n_train 5model_path: Path to the pretrained language model.task: Which task to run.data_path: Path to the dataset containing tool descriptions and queries.n_train: Number of training examples for each class. This is only used for test set split.python repc.py --few_shot_baseline --model_path teknium/OpenHermes-2.5-Mistral-7B --task tool --data_path data/data_within_tool_subset.json --n_train 5 --num_examples 3model_path: Path to the pretrained language model.task: Which task to run.data_path: Path to the dataset containing tool descriptions and queries.n_train: Number of training examples for each class. This is only used for test set split.num_examples: Number of examples as demonstration.python repc.py --train --evaluate --zero_baseline --few_shot_baseline --model_path teknium/OpenHermes-2.5-Mistral-7B --task tool --data_path data/data_within_tool_subset.json --n_train 5 --num_examples 3 --classifier svm --model_save_dir saved_models --use_cache1from repc import *
2
3tools = ['CatIndexTool', 'SearchAlertsTool', 'VisualizationTool', 'SearchAnomalyDetectorsTool', 'SearchAnomalyResultsTool', 'SearchMonitorsTool', 'PPLTool', 'RAGTool']
4questions = ["What is the number of documents in the index .kibana_1?", "How many alerts have severity level 1?"]
5repc = RepC(model_path="teknium/OpenHermes-2.5-Mistral-7B", task="tool", device="auto")
6predictions = repc.predict(classifier="svm", model_path="saved_models_n5/svm_l13.pkl", input=questions)
7predictions = [tools[p] for p in predictions]
8print(predictions)| Method | Accuracy (%) | Macro F1 (%) |
|-----------------------|--------------|--------------|
| RepC-layer | 94.99 | 89.04 |
| RepC-ensemble | 91.02 | 81.94 |
| Zero-baseline | 10.86 | 25.95 |
| 3-shot-baseline | 6.47 | 31.06 |