diff --git a/ollama.py b/ollama.py index ef50b95d..d704ddd9 100644 --- a/ollama.py +++ b/ollama.py @@ -132,6 +132,7 @@ def generate_route_handler(): data = request.get_json() model = data.get("model") prompt = data.get("prompt") + prompt = template(model, prompt) if not model: return Response("Model is required", status=400) if not prompt: diff --git a/template.py b/template.py index 9c1ca307..31faff63 100644 --- a/template.py +++ b/template.py @@ -2,7 +2,6 @@ from difflib import SequenceMatcher model_prompts = { "alpaca": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{prompt}\n\n### Response:\n\n", - "ggml": "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n\n### Human: Hello, Assistant.\n### Assistant: Hello. How may I help you today?\n### Human: ${prompt}", "gpt4": "### Instruction:\n{prompt}\n\n### Response:\n", "hermes": "### Instruction:\n{prompt}\n\n### Response:\n", "oasst": "{prompt}",