Spaces:
Running
Running
File size: 983 Bytes
59d5667 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from models.model_seeds import seeds
from models.openai.finetuned_models import finetuned_models, get_finetuned_chain
from models.openai.role_models import get_role_chain, get_template_role_models
from models.databricks.scenario_sim_biz import get_databricks_chain
def get_chain(issue, language, source, memory, temperature, texter_name=""):
if source in ("OA_finetuned"):
OA_engine = finetuned_models[f"{issue}-{language}"]
return get_finetuned_chain(OA_engine, memory, temperature)
elif source in ('OA_rolemodel'):
seed = seeds.get(issue, "GCT")['prompt']
template = get_template_role_models(issue, language, texter_name=texter_name, seed=seed)
return get_role_chain(template, memory, temperature)
elif source in ('CTL_llama2'):
if language == "English":
language = "en"
elif language == "Spanish":
language = "es"
return get_databricks_chain(issue, language, memory, temperature) |