@@ -21,7 +21,7 @@ import (
2121 "github.com/knights-analytics/hugot/util/imageutil"
2222)
2323
24- const modelsFolder = "../../models/"
24+ const ModelsFolder = "../../models/"
2525
2626// test download validation
2727
@@ -41,7 +41,7 @@ func TestDownloadValidation(t *testing.T) {
4141func FeatureExtractionPipeline (t * testing.T , session * hugot.Session ) {
4242 t .Helper ()
4343
44- modelPath := modelsFolder + "KnightsAnalytics_all-MiniLM-L6-v2"
44+ modelPath := ModelsFolder + "KnightsAnalytics_all-MiniLM-L6-v2"
4545
4646 config := hugot.FeatureExtractionConfig {
4747 ModelPath : modelPath ,
@@ -167,7 +167,7 @@ func FeatureExtractionPipeline(t *testing.T, session *hugot.Session) {
167167func FeatureExtractionPipelineValidation (t * testing.T , session * hugot.Session ) {
168168 t .Helper ()
169169
170- modelPath := modelsFolder + "KnightsAnalytics_all-MiniLM-L6-v2"
170+ modelPath := ModelsFolder + "KnightsAnalytics_all-MiniLM-L6-v2"
171171 config := hugot.FeatureExtractionConfig {
172172 ModelPath : modelPath ,
173173 OnnxFilename : "model.onnx" ,
@@ -191,7 +191,7 @@ func FeatureExtractionPipelineValidation(t *testing.T, session *hugot.Session) {
191191func TextClassificationPipeline (t * testing.T , session * hugot.Session ) {
192192 t .Helper ()
193193
194- modelPath := modelsFolder + "KnightsAnalytics_distilbert-base-uncased-finetuned-sst-2-english"
194+ modelPath := ModelsFolder + "KnightsAnalytics_distilbert-base-uncased-finetuned-sst-2-english"
195195
196196 config := hugot.TextClassificationConfig {
197197 ModelPath : modelPath ,
@@ -245,7 +245,7 @@ func TextClassificationPipeline(t *testing.T, session *hugot.Session) {
245245func TextClassificationPipelineMulti (t * testing.T , session * hugot.Session ) {
246246 t .Helper ()
247247
248- modelPathMulti := modelsFolder + "KnightsAnalytics_roberta-base-go_emotions"
248+ modelPathMulti := ModelsFolder + "KnightsAnalytics_roberta-base-go_emotions"
249249
250250 configMulti := hugot.TextClassificationConfig {
251251 ModelPath : modelPathMulti ,
@@ -408,7 +408,7 @@ func TextClassificationPipelineMulti(t *testing.T, session *hugot.Session) {
408408func TextClassificationPipelineValidation (t * testing.T , session * hugot.Session ) {
409409 t .Helper ()
410410
411- modelPath := modelsFolder + "KnightsAnalytics_distilbert-base-uncased-finetuned-sst-2-english"
411+ modelPath := ModelsFolder + "KnightsAnalytics_distilbert-base-uncased-finetuned-sst-2-english"
412412
413413 config := hugot.TextClassificationConfig {
414414 ModelPath : modelPath ,
@@ -446,7 +446,7 @@ func TextClassificationPipelineValidation(t *testing.T, session *hugot.Session)
446446func ZeroShotClassificationPipeline (t * testing.T , session * hugot.Session ) {
447447 t .Helper ()
448448
449- modelPath := modelsFolder + "KnightsAnalytics_deberta-v3-base-zeroshot-v1"
449+ modelPath := ModelsFolder + "KnightsAnalytics_deberta-v3-base-zeroshot-v1"
450450
451451 config := hugot.ZeroShotClassificationConfig {
452452 ModelPath : modelPath ,
@@ -670,7 +670,7 @@ func ZeroShotClassificationPipeline(t *testing.T, session *hugot.Session) {
670670func ZeroShotClassificationPipelineValidation (t * testing.T , session * hugot.Session ) {
671671 t .Helper ()
672672
673- modelPath := modelsFolder + "KnightsAnalytics_deberta-v3-base-zeroshot-v1"
673+ modelPath := ModelsFolder + "KnightsAnalytics_deberta-v3-base-zeroshot-v1"
674674
675675 config := hugot.TextClassificationConfig {
676676 ModelPath : modelPath ,
@@ -705,7 +705,7 @@ func ZeroShotClassificationPipelineValidation(t *testing.T, session *hugot.Sessi
705705func TokenClassificationPipeline (t * testing.T , session * hugot.Session ) {
706706 t .Helper ()
707707
708- modelPath := modelsFolder + "KnightsAnalytics_distilbert-NER"
708+ modelPath := ModelsFolder + "KnightsAnalytics_distilbert-NER"
709709 configSimple := hugot.TokenClassificationConfig {
710710 ModelPath : modelPath ,
711711 Name : "testPipelineSimple" ,
@@ -849,7 +849,7 @@ func TokenClassificationPipeline(t *testing.T, session *hugot.Session) {
849849func TokenClassificationPipelineValidation (t * testing.T , session * hugot.Session ) {
850850 t .Helper ()
851851
852- modelPath := modelsFolder + "KnightsAnalytics_distilbert-NER"
852+ modelPath := ModelsFolder + "KnightsAnalytics_distilbert-NER"
853853 configSimple := hugot.TokenClassificationConfig {
854854 ModelPath : modelPath ,
855855 Name : "testPipelineSimple" ,
@@ -887,7 +887,7 @@ func TokenClassificationPipelineValidation(t *testing.T, session *hugot.Session)
887887func CrossEncoderPipeline (t * testing.T , session * hugot.Session ) {
888888 t .Helper ()
889889 config := hugot.CrossEncoderConfig {
890- ModelPath : modelsFolder + "KnightsAnalytics_jina-reranker-v1-tiny-en" ,
890+ ModelPath : ModelsFolder + "KnightsAnalytics_jina-reranker-v1-tiny-en" ,
891891 Name : "test-cross-encoder" ,
892892 }
893893 pipeline , err := hugot .NewPipeline (session , config )
@@ -943,7 +943,7 @@ func CrossEncoderPipeline(t *testing.T, session *hugot.Session) {
943943func CrossEncoderPipelineValidation (t * testing.T , session * hugot.Session ) {
944944 t .Helper ()
945945 config := hugot.CrossEncoderConfig {
946- ModelPath : modelsFolder + "KnightsAnalytics_jina-reranker-v1-tiny-en" ,
946+ ModelPath : ModelsFolder + "KnightsAnalytics_jina-reranker-v1-tiny-en" ,
947947 Name : "test-cross-encoder-validation" ,
948948 }
949949 pipeline , err := hugot .NewPipeline (session , config )
@@ -977,8 +977,8 @@ func CrossEncoderPipelineValidation(t *testing.T, session *hugot.Session) {
977977func ImageClassificationPipeline (t * testing.T , session * hugot.Session ) {
978978 t .Helper ()
979979
980- modelPath := modelsFolder + "/ KnightsAnalytics_resnet50"
981- imagePath := modelsFolder + "/ imageData/cat.jpg"
980+ modelPath := ModelsFolder + "KnightsAnalytics_resnet50"
981+ imagePath := ModelsFolder + "imageData/cat.jpg"
982982
983983 config := hugot.ImageClassificationConfig {
984984 ModelPath : modelPath ,
@@ -1013,7 +1013,7 @@ func ImageClassificationPipeline(t *testing.T, session *hugot.Session) {
10131013func ImageClassificationPipelineValidation (t * testing.T , session * hugot.Session ) {
10141014 t .Helper ()
10151015
1016- modelPath := modelsFolder + "/KnightsAnalytics_resnet50"
1016+ modelPath := ModelsFolder + "/KnightsAnalytics_resnet50"
10171017 config := hugot.ImageClassificationConfig {
10181018 ModelPath : modelPath ,
10191019 Name : "testImageClassification" ,
@@ -1033,7 +1033,7 @@ func ObjectDetectionPipeline(t *testing.T, session *hugot.Session) {
10331033 t .Helper ()
10341034
10351035 config := backends.PipelineConfig [* pipelines.ObjectDetectionPipeline ]{
1036- ModelPath : modelsFolder + "/ KnightsAnalytics_detr-resnet-50" ,
1036+ ModelPath : ModelsFolder + "KnightsAnalytics_detr-resnet-50" ,
10371037 Name : "testObjectDetection" ,
10381038 Options : []backends.PipelineOption [* pipelines.ObjectDetectionPipeline ]{
10391039 pipelines .WithNCHWFormat [* pipelines.ObjectDetectionPipeline ](),
@@ -1047,7 +1047,7 @@ func ObjectDetectionPipeline(t *testing.T, session *hugot.Session) {
10471047 CheckT (t , err )
10481048
10491049 // Use a simple cat image similar to classification test style
1050- inputs := []string {"models/ imageData/cat.jpg" }
1050+ inputs := []string {ModelsFolder + " imageData/cat.jpg" }
10511051 result , err := pipeline .RunPipeline (t .Context (), inputs )
10521052 CheckT (t , err )
10531053
@@ -1081,7 +1081,7 @@ func ObjectDetectionPipelineValidation(t *testing.T, session *hugot.Session) {
10811081 t .Helper ()
10821082
10831083 config := backends.PipelineConfig [* pipelines.ObjectDetectionPipeline ]{
1084- ModelPath : modelsFolder + "/ KnightsAnalytics_detr-resnet-50" ,
1084+ ModelPath : ModelsFolder + "KnightsAnalytics_detr-resnet-50" ,
10851085 Name : "testObjectDetectionValidation" ,
10861086 }
10871087 pipeline , err := hugot .NewPipeline (session , config )
@@ -1137,7 +1137,7 @@ func ObjectDetectionPipelineValidation(t *testing.T, session *hugot.Session) {
11371137
11381138func NoSameNamePipeline (t * testing.T , session * hugot.Session ) {
11391139 t .Helper ()
1140- modelPath := modelsFolder + "/KnightsAnalytics_distilbert-NER"
1140+ modelPath := ModelsFolder + "/KnightsAnalytics_distilbert-NER"
11411141 configSimple := hugot.TokenClassificationConfig {
11421142 ModelPath : modelPath ,
11431143 Name : "testPipelineSimple" ,
@@ -1157,7 +1157,7 @@ func NoSameNamePipeline(t *testing.T, session *hugot.Session) {
11571157func DestroyPipelines (t * testing.T , session * hugot.Session ) {
11581158 t .Helper ()
11591159
1160- modelPath := modelsFolder + "/KnightsAnalytics_distilbert-NER"
1160+ modelPath := ModelsFolder + "/KnightsAnalytics_distilbert-NER"
11611161 configSimple := hugot.TokenClassificationConfig {
11621162 ModelPath : modelPath ,
11631163 Name : "testClosePipeline" ,
@@ -1196,7 +1196,7 @@ func DestroyPipelines(t *testing.T, session *hugot.Session) {
11961196// Text Generation.
11971197func TextGenerationPipeline (t * testing.T , session * hugot.Session ) {
11981198 t .Helper ()
1199- modelPath := modelsFolder + "/KnightsAnalytics_qwen3-4B-int4"
1199+ modelPath := ModelsFolder + "/KnightsAnalytics_qwen3-4B-int4"
12001200
12011201 defer func (session * hugot.Session ) {
12021202 err := session .Destroy ()
@@ -1396,7 +1396,7 @@ func TextGenerationPipelineValidation(t *testing.T, session *hugot.Session) {
13961396
13971397 // Configure the text generation pipeline
13981398 config := hugot.TextGenerationConfig {
1399- ModelPath : modelsFolder + "/KnightsAnalytics_qwen3-4B-int4" ,
1399+ ModelPath : ModelsFolder + "/KnightsAnalytics_qwen3-4B-int4" ,
14001400 Name : "testPipeline" ,
14011401 Options : []backends.PipelineOption [* pipelines.TextGenerationPipeline ]{},
14021402 }
@@ -1412,7 +1412,7 @@ func TextGenerationPipelineValidation(t *testing.T, session *hugot.Session) {
14121412func QuestionAnsweringPipeline (t * testing.T , session * hugot.Session ) {
14131413 t .Helper ()
14141414
1415- modelPath := modelsFolder + "/KnightsAnalytics_distilbert-onnx"
1415+ modelPath := ModelsFolder + "/KnightsAnalytics_distilbert-onnx"
14161416
14171417 config := hugot.QuestionAnsweringConfig {
14181418 ModelPath : modelPath ,
@@ -1480,7 +1480,7 @@ func QuestionAnsweringPipeline(t *testing.T, session *hugot.Session) {
14801480func TabularPipeline (t * testing.T , session * hugot.Session ) {
14811481 t .Helper ()
14821482 config := backends.PipelineConfig [* pipelines.TabularPipeline ]{
1483- ModelPath : modelsFolder + "/KnightsAnalytics_iris-decision-tree" ,
1483+ ModelPath : ModelsFolder + "/KnightsAnalytics_iris-decision-tree" ,
14841484 Name : "testTabularClassification" ,
14851485 Options : []backends.PipelineOption [* pipelines.TabularPipeline ]{
14861486 pipelines .WithIDLabelMap (map [int ]string {
@@ -1520,7 +1520,7 @@ func ThreadSafety(t *testing.T, session *hugot.Session, numEmbeddings int) {
15201520 numResults := numWorkers * numEmbeddings
15211521
15221522 t .Helper ()
1523- modelPath := modelsFolder + "/KnightsAnalytics_all-MiniLM-L6-v2"
1523+ modelPath := ModelsFolder + "/KnightsAnalytics_all-MiniLM-L6-v2"
15241524 config := hugot.FeatureExtractionConfig {
15251525 ModelPath : modelPath ,
15261526 Name : "testPipeline" ,
0 commit comments