chore: Update requirements.txt and refactor import statements for ChatMessageHistory in model.py and space.py
Browse files- kitt/core/model.py +1 -1
- space.py +11 -2
kitt/core/model.py
CHANGED
@@ -358,7 +358,7 @@ def load_gpu_model():
|
|
358 |
device_map="auto",
|
359 |
load_in_8bit=False,
|
360 |
load_in_4bit=True,
|
361 |
-
|
362 |
)
|
363 |
|
364 |
return model, tokenizer
|
|
|
358 |
device_map="auto",
|
359 |
load_in_8bit=False,
|
360 |
load_in_4bit=True,
|
361 |
+
use_flash_attention_2=True,
|
362 |
)
|
363 |
|
364 |
return model, tokenizer
|
space.py
CHANGED
@@ -1,9 +1,11 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
from langchain.tools import tool
|
|
|
4 |
from langchain_core.utils.function_calling import convert_to_openai_tool
|
5 |
from loguru import logger
|
6 |
-
import spaces
|
7 |
|
8 |
from kitt.core import tts_gradio
|
9 |
from kitt.core import utils as kitt_utils
|
@@ -28,6 +30,13 @@ from kitt.skills import (
|
|
28 |
from kitt.skills.common import config, vehicle
|
29 |
from kitt.skills.routing import calculate_route, find_address
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
ORIGIN = "Luxembourg, Luxembourg"
|
32 |
DESTINATION = "Paris, France"
|
33 |
DEFAULT_LLM_BACKEND = "local"
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
import gradio as gr
|
4 |
+
import spaces
|
5 |
from langchain.tools import tool
|
6 |
+
from langchain_community.chat_message_histories import ChatMessageHistory
|
7 |
from langchain_core.utils.function_calling import convert_to_openai_tool
|
8 |
from loguru import logger
|
|
|
9 |
|
10 |
from kitt.core import tts_gradio
|
11 |
from kitt.core import utils as kitt_utils
|
|
|
30 |
from kitt.skills.common import config, vehicle
|
31 |
from kitt.skills.routing import calculate_route, find_address
|
32 |
|
33 |
+
subprocess.run(
|
34 |
+
"pip install flash-attn --no-build-isolation",
|
35 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
36 |
+
shell=True,
|
37 |
+
)
|
38 |
+
|
39 |
+
|
40 |
ORIGIN = "Luxembourg, Luxembourg"
|
41 |
DESTINATION = "Paris, France"
|
42 |
DEFAULT_LLM_BACKEND = "local"
|