diff --git a/nodes/local_llm.py b/nodes/local_llm.py index 701fb6b..a390249 100644 --- a/nodes/local_llm.py +++ b/nodes/local_llm.py @@ -33,24 +33,12 @@ class QueryLocalLLM: def call_api(self, prompt_text, url, context_length, seed): payload = { - "prompt": f"{prompt_text}\nAssistant: ", - "use_story": False, - "use_memory": False, - "use_authors_note": False, - "use_world_info": False, - "max_context_length": context_length, - "max_length": 300, - "rep_pen": 1.1, - "rep_pen_range": 600, - "rep_pen_slope": 0, - "temperature": 1, - "tfs": 1, - "top_a": 0, - "top_k": 0, + "messages": [ + { "role": "system", "content": "You are an assistant designed to create more imaginative and beautiful images by expanding on the image prompt a user gives you. Respond only with your expanded prompt text. Here is the user's prompt:" }, + { "role": "user", "content": f"{prompt_text}\n" }], + "max_tokens": 300, + "temperature": 0.7, "top_p": 0.95, - "typical": 1, - "sampler_order": [6, 0, 1, 2, 3, 4, 5], - "singleline": False, "seed": seed } @@ -61,7 +49,7 @@ class QueryLocalLLM: if response.status_code == 200: result_json = response.json() - generatedText = result_json["results"][0]["text"] + generatedText = result_json["choices"][0]["message"]["content"] print("Response: " + generatedText)