diff --git a/py/api.py b/py/api.py index 7582c39..6a16824 100644 --- a/py/api.py +++ b/py/api.py @@ -1,9 +1,9 @@ import requests import json from gradio_client import Client -import os from mistralai import Mistral + class API: @staticmethod def process_text_mistralai(prompt, model, system): @@ -27,6 +27,7 @@ class API: ] ) return chat_response.choices[0].message.content + @staticmethod def process_text_gradio(prompt, model, system): client = Client(model) @@ -38,7 +39,7 @@ class API: top_p=0.95, api_name="/chat" ) - return result; + return result # This method processes a message via ollama @staticmethod @@ -73,7 +74,7 @@ class API: elif model == 4: answer = self.process_text_gradio(message, "PatrickPluto/InterstellarAIChatbot", system) elif model == 5: - answer = self.process_text_mistralai(message, "mistral-large-latest", system) + answer = self.process_text_mistralai(message, "open-mistral-7b", system) elif model == 6: answer = self.process_text_mistralai(message, "codestral-latest", system) else: diff --git a/py/install.sh b/py/install.sh index fbbea2b..ce497b4 100755 --- a/py/install.sh +++ b/py/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -python3 -m venv venv +python -m venv venv source venv/bin/activate pip install flask pip install SpeechRecognition @@ -11,7 +11,10 @@ pip install pyqt5 pip install pyqtwebengine pip install gradio_client pip install mistralai +pip install pyperclip ollama pull phi3.5 ollama pull codegemma:2b ollama pull gemma2:9b + +python web_flask.py \ No newline at end of file diff --git a/py/templates/index.html b/py/templates/index.html index 0ddb62e..548d50a 100644 --- a/py/templates/index.html +++ b/py/templates/index.html @@ -112,13 +112,13 @@ {% endif %} {% endfor %}
@@ -127,7 +127,7 @@