-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DH-4952/finetuning agent initial commit
- Loading branch information
1 parent
45e77c7
commit 6abc80a
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
import time | ||
from typing import List, Tuple | ||
|
||
from overrides import override | ||
|
||
from dataherald.sql_database.models.types import ( | ||
DatabaseConnection, | ||
) | ||
from dataherald.sql_generator import SQLGenerator | ||
from dataherald.types import Question, Response | ||
|
||
|
||
class DataheraldFineTunedAgent(SQLGenerator): | ||
|
||
@override | ||
def generate_response( | ||
self, | ||
user_question: Question, | ||
database_connection: DatabaseConnection, | ||
context: Tuple[List[dict] | None, List[dict] | None], | ||
) -> Response: | ||
start_time = time.time() | ||
instructions = context[1] | ||
|
||
self.short_context_llm = self.model.get_model( | ||
database_connection=database_connection, | ||
temperature=0, | ||
model_name=os.getenv("LLM_MODEL", "gpt-4"), | ||
) | ||
self.long_context_llm = self.model.get_model( | ||
database_connection=database_connection, | ||
temperature=0, | ||
model_name=os.getenv("AGENT_LLM_MODEL", "gpt-4-32k") | ||
) |