diff --git a/py/api.py b/py/api.py index 413f951..d3db341 100644 --- a/py/api.py +++ b/py/api.py @@ -4,6 +4,7 @@ from transformers import AutoTokenizer, LlamaForCausalLM class API: + # This method processes a message via transformers. (NOT FINISHED!) @staticmethod def process_text_transformers(prompt, model): model = LlamaForCausalLM.from_pretrained(model) @@ -14,6 +15,7 @@ class API: generate_ids = model.generate(inputs.input_ids, max_length=30) return tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0] + # This method processes a message via ollama @staticmethod def process_text_local(prompt, model): ollama_url = "http://localhost:11434" @@ -34,6 +36,7 @@ class API: else: return "Error: " + response.text + # This method sends a message to a certain AI. def send_message(self, message, model): if model == 1: answer = self.process_text_local(message, "phi3.5") diff --git a/py/static/index.html b/py/templates/index.html similarity index 80% rename from py/static/index.html rename to py/templates/index.html index d688702..3425d0a 100644 --- a/py/static/index.html +++ b/py/templates/index.html @@ -71,19 +71,22 @@