55 Usage: You can pass in a model name:
66 python llmware_model_fast_start.py llmware/bling-1b-0.1
77 If you do not specify a model you will be prompted to pick one
8+
9+ This example uses the RAG Benchmark test set, which can be pulled down from the LLMWare repository on
10+ Huggingface at: www.huggingface.co/llmware/rag_instruct_benchmark_tester, or by using the
11+ datasets library, which can be installed with:
12+
13+ `pip3 install datasets`
14+
815"""
916
1017import re
1118import sys
1219import time
1320import torch
14- from datasets import load_dataset
1521from huggingface_hub import hf_api , ModelFilter , ModelCard
16- from tabulate import tabulate
1722from transformers import AutoModelForCausalLM , AutoTokenizer
1823
24+ # The datasets package is not installed automatically by llmware
25+ try :
26+ from datasets import load_dataset
27+ except ImportError :
28+ raise ImportError ("This example requires the 'datasets' Python package. "
29+ "You can install it with 'pip3 install datasets'" )
30+
1931
2032# Query HuggingFace and get the llmware models. Return the the components of a table: headers and data
2133def get_llmware_models ():
@@ -38,13 +50,21 @@ def get_llmware_models():
3850
3951
4052def print_llmware_models ():
53+
4154 table_headers , table_data = get_llmware_models ()
42- print (tabulate (table_data , headers = table_headers , tablefmt = "plain" , numalign = "right" ))
55+
56+ print (table_headers [0 ], "\t \t " , table_headers [1 ], "\t \t " , table_headers [2 ])
57+ for row in table_data :
58+ print (row [0 ], "\t \t " , row [1 ], "\t \t " , row [2 ])
4359
4460
4561def prompt_user_for_model_selection (prompt = None ):
62+
4663 table_headers , table_data = get_llmware_models ()
47- print (tabulate (table_data , headers = table_headers , tablefmt = "plain" , numalign = "right" ))
64+
65+ print (table_headers [0 ], "\t \t " , table_headers [1 ], "\t \t " , table_headers [2 ])
66+ for row in table_data :
67+ print (row [0 ], "\t \t " , row [1 ], "\t \t " , row [2 ])
4868
4969 num_models = len (table_data )
5070
0 commit comments