Spaces:
Running
Running
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() | |