File size: 895 Bytes
273fb56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from conversation import conv_templates

application_conversation_map = {
    "mm-rag": "default",
    "llava-med": "llavamed_rag"
}

def get_conversation_template():
    application = os.getenv("APPLICATION", "mm-rag")
    print(f"Running application: {application}")
    try:
        if application.lower() in application_conversation_map.keys():
            if application_conversation_map[application.lower()] in conv_templates.keys():
                return conv_templates[application_conversation_map[application.lower()]]
            else:
                raise KeyError(f"Application {application} does not support yet!")
        else:
                raise KeyError(f"Application {application} does not support yet!")
    except:
          raise KeyError(f"Application {application} does not support yet!")

# get conversation template
cur_conv = get_conversation_template()