WilliamGazeley
commited on
Commit
·
d5870e6
1
Parent(s):
183e5bc
Fix pydantic reserved var name collision
Browse files- src/app.py +1 -0
- src/config.py +1 -1
- src/functioncall.py +2 -2
src/app.py
CHANGED
|
@@ -6,6 +6,7 @@ from utils import get_assistant_message
|
|
| 6 |
from functioncall import ModelInference
|
| 7 |
from prompter import PromptManager
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
@st.cache_resource(show_spinner="Loading model..")
|
| 11 |
def init_llm():
|
|
|
|
| 6 |
from functioncall import ModelInference
|
| 7 |
from prompter import PromptManager
|
| 8 |
|
| 9 |
+
print("Why, hello there!", flush=True)
|
| 10 |
|
| 11 |
@st.cache_resource(show_spinner="Loading model..")
|
| 12 |
def init_llm():
|
src/config.py
CHANGED
|
@@ -3,7 +3,7 @@ from pydantic_settings import BaseSettings
|
|
| 3 |
|
| 4 |
class Config(BaseSettings):
|
| 5 |
hf_token: str = Field(...)
|
| 6 |
-
|
| 7 |
headless: bool = Field(False, description="Run in headless mode.")
|
| 8 |
|
| 9 |
chat_template: str = Field("chatml", description="Chat template for prompt formatting")
|
|
|
|
| 3 |
|
| 4 |
class Config(BaseSettings):
|
| 5 |
hf_token: str = Field(...)
|
| 6 |
+
hf_model: str = Field("InvestmentResearchAI/LLM-ADE-dev")
|
| 7 |
headless: bool = Field(False, description="Run in headless mode.")
|
| 8 |
|
| 9 |
chat_template: str = Field("chatml", description="Chat template for prompt formatting")
|
src/functioncall.py
CHANGED
|
@@ -33,7 +33,7 @@ class ModelInference:
|
|
| 33 |
bnb_4bit_use_double_quant=True,
|
| 34 |
)
|
| 35 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 36 |
-
config.
|
| 37 |
trust_remote_code=True,
|
| 38 |
return_dict=True,
|
| 39 |
quantization_config=self.bnb_config,
|
|
@@ -42,7 +42,7 @@ class ModelInference:
|
|
| 42 |
device_map="auto",
|
| 43 |
)
|
| 44 |
|
| 45 |
-
self.tokenizer = AutoTokenizer.from_pretrained(config.
|
| 46 |
self.tokenizer.pad_token = self.tokenizer.eos_token
|
| 47 |
self.tokenizer.padding_side = "left"
|
| 48 |
|
|
|
|
| 33 |
bnb_4bit_use_double_quant=True,
|
| 34 |
)
|
| 35 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 36 |
+
config.hf_model,
|
| 37 |
trust_remote_code=True,
|
| 38 |
return_dict=True,
|
| 39 |
quantization_config=self.bnb_config,
|
|
|
|
| 42 |
device_map="auto",
|
| 43 |
)
|
| 44 |
|
| 45 |
+
self.tokenizer = AutoTokenizer.from_pretrained(config.hf_model, trust_remote_code=True)
|
| 46 |
self.tokenizer.pad_token = self.tokenizer.eos_token
|
| 47 |
self.tokenizer.padding_side = "left"
|
| 48 |
|