Views
No views yet
inference.py - Simple inference function: Text in, text outeval_prompts.json - A set of prompts to run evaluation on modelsrun_eval.py - Uses inference.py & eval_prompts.json to run evaluation on all local models and save responses to markdownrequirements.txt - Python dependenciesmyenv/ - Python virtual environmentsource myenv/bin/activatepip install -r requirements.txtpython run_eval.pypython inference.pyinference.py)eval_prompts.json)run_eval.py)config.jsonmodel.safetensorstokenizer.jsonvocab.json1from inference import ModelInference, get_local_models
2
3# Find all models
4models = get_local_models()
5print(f"Found {len(models)} models")
6
7# Quick inference
8from inference import simple_inference
9result = simple_inference(models[0], "What is AI?", max_length=256)
10print(result)
11
12# Advanced usage
13inference = ModelInference(models[0])
14if inference.load_model():
15 response = inference.generate_text("Explain Python", max_length=512, temperature=0.7)
16 print(response)
17 inference.unload_model()evaluation_results.md) with: