Skip to content

Commit

Permalink
Merge pull request #76 from fractalego/llm-webserving
Browse files Browse the repository at this point in the history
Llm webserving
  • Loading branch information
fractalego authored Dec 20, 2023
2 parents 1e1f770 + 7d7e7ed commit 769aeab
Show file tree
Hide file tree
Showing 112 changed files with 583 additions and 4,556 deletions.
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ flask[async]==2.0.1
flask-cors==3.0.10
flask_dropzone==1.6.0
accelerate==0.20.3
bitsandbytes==0.35.3
bitsandbytes==0.41.3
torch==2.0.0
optimum==1.8.5
transformers==4.35.0
optimum==1.15.0
flash-attn==2.3.6
transformers==4.35.2
nltk==3.6.2
gensim==4.3.1
sklearn==0.0
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"wafl.connectors.factories",
"wafl.connectors.local",
"wafl.connectors.remote",
"wafl.entailment",
"wafl.events",
"wafl.extractors",
"wafl.filter",
Expand All @@ -39,7 +40,6 @@
package_data={
"wafl": [
"templates/*",
"templates/**/*",
"sounds/*",
"models/*",
"frontend/*",
Expand All @@ -51,10 +51,11 @@
"flask_dropzone==1.6.0",
"werkzeug==2.1.2",
"accelerate==0.20.3",
"bitsandbytes==0.35.3",
"bitsandbytes==0.41.3",
"torch==2.0.0",
"optimum==1.8.5",
"transformers==4.35.0",
"optimum==1.15.0",
"flash-attn==2.3.6",
"transformers==4.35.2",
"nltk==3.6.2",
"gensim==4.3.1",
"sklearn==0.0",
Expand Down
Empty file removed tests/backward_import/functions.py
Empty file.
1 change: 0 additions & 1 deletion tests/backward_import/rules.wafl

This file was deleted.

24 changes: 7 additions & 17 deletions tests/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"waking_up_word": "computer",
"waking_up_sound": true,
"deactivate_sound": true,
"improvise_tasks": true,
"improvise_tasks": false,
"rules": "rules.yaml",
"functions": "functions.py",
"llm_model": {
"model_is_local": false,
"local_model": "mosaicml/mpt-7b-instruct",
"local_model": "mistralai/Mistral-7B-Instruct-v0.1",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
},
"listener_model": {
"model_is_local": false,
"local_model": "fractalego/personal-whisper-medium.en-model",
"local_model": "fractalego/personal-whisper-distilled-model",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
Expand All @@ -33,23 +35,11 @@
},
"entailment_model": {
"model_is_local": false,
"local_model": "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
"local_model": "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
},
"text_embedding_model": {
"model_is_local": false,
"local_model": "msmarco-distilbert-base-v3",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
},
"qa_embedding_model": {
"model_is_local": false,
"local_model": "multi-qa-distilbert-dot-v1",
"local_model": "TaylorAI/gte-tiny",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
Expand Down
28 changes: 0 additions & 28 deletions tests/events.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from fuzzywuzzy import process
from word2number import w2n
from wafl.exceptions import CloseConversation, InterruptTask
from preprocess_test_functions import b, c

_logger = logging.getLogger(__file__)

Expand Down
Empty file removed tests/greetings/facts/functions.py
Empty file.
1 change: 0 additions & 1 deletion tests/greetings/facts/rules.wafl

This file was deleted.

2 changes: 0 additions & 2 deletions tests/greetings/functions.py

This file was deleted.

20 changes: 0 additions & 20 deletions tests/greetings/rules.wafl

This file was deleted.

2 changes: 0 additions & 2 deletions tests/greetings/rules/functions.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/greetings/rules/rules.wafl

This file was deleted.

24 changes: 7 additions & 17 deletions tests/local_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"waking_up_word": "computer",
"waking_up_sound": true,
"deactivate_sound": true,
"improvise_tasks": true,
"improvise_tasks": false,
"rules": "rules.yaml",
"functions": "functions.py",
"llm_model": {
"model_is_local": true,
"local_model": "NousResearch/Nous-Hermes-llama-2-7b",
"local_model": "mistralai/Mistral-7B-Instruct-v0.1",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
},
"listener_model": {
"model_is_local": true,
"local_model": "fractalego/personal-whisper-medium.en-model",
"local_model": "fractalego/personal-whisper-distilled-model",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
Expand All @@ -33,23 +35,11 @@
},
"entailment_model": {
"model_is_local": true,
"local_model": "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
"local_model": "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
},
"text_embedding_model": {
"model_is_local": true,
"local_model": "msmarco-distilbert-base-v3",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
}
},
"qa_embedding_model": {
"model_is_local": true,
"local_model": "multi-qa-distilbert-dot-v1",
"local_model": "TaylorAI/gte-tiny",
"remote_model": {
"model_host": "localhost",
"model_port": 8080
Expand Down
10 changes: 0 additions & 10 deletions tests/preprocess_test_functions.py

This file was deleted.

4 changes: 0 additions & 4 deletions tests/rules.wafl

This file was deleted.

49 changes: 49 additions & 0 deletions tests/rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
facts:
- This bot is doing well
- This bot is called Computer
- The user lives in Eltham, London

rules:
- the user wants to compute some math operation:
- Think of the python code that solves the math problem and assigns the result to the variable "result"
- For example "what is the result of 2 + 2?" should output "<execute>result = 2 + 2</execute>"
- Another example "what is the square root of 2?" should output "<execute>import math;result = math.sqrt(2)</execute>"
- output exactly the following "<execute>result = PYTHON CODE THAT SOLVES THE PROBLEM</execute>"

- the user wants to know the time:
- output "The time is <execute>get_time()</execute>".

- the user wants to know today's date:
- output "The date is <execute>get_date()</execute>".

- the user wants to know today's day of the week:
- output "The day of the week is <execute>get_day()</execute>".

- the user wants to know the weather today:
- output "<execute>check_today_weather()</execute>".

- the user wants to know the weather tomorrow:
- output "<execute>check_tomorrow_weather()</execute>".

- the user wants to summarise a website:
- you'll need the website url to summarise
- output exactly "<remember> The website content is <execute>get_website('WEBSITE_URL')</execute> </remember>".
- summarise the website content given what you remember
- output the summary

- the user wants to know what is in the shopping list:
- output "<execute>get_shopping_list()</execute>".

- the user wants to add something to the shopping list:
- The task here is to add the item to the shopping list using a python function
- example "add milk to the shopping list" should output "<execute>add_to_shopping_list(['milk'])</execute>"
- output "<execute>add_to_shopping_list(ITEMS_TO_ADD)</execute>".

- the user wants to remove something to the shopping list:
- The task here is to remove the item from the shopping list using a python function
- example "remove milk from the shopping list" should output "<execute>remove_from_shopping_list(['milk'])</execute>"
- output "<execute>remove_from_shopping_list(ITEMS_TO_REMOVE)</execute>".

- the user asks something about cities, capitals, countries, buildings, famous people, bars, restaurants, rivers, mountains, lakes, seas, oceans, planets, stars, galaxies:
- say that you are just improvising the answer
- say what you think answer the question
48 changes: 0 additions & 48 deletions tests/test__explaination_happens_when_answer_is_false.py

This file was deleted.

Loading

0 comments on commit 769aeab

Please sign in to comment.