Skip to content

Commit

Permalink
Reenable Google Colab Model (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 authored Oct 4, 2023
1 parent 7cc54ee commit 499dfb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/danswer/llm/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from danswer.configs.app_configs import QA_TIMEOUT
from danswer.configs.constants import DanswerGenAIModel
from danswer.configs.constants import ModelHostType
from danswer.configs.model_configs import API_TYPE_OPENAI
from danswer.configs.model_configs import GEN_AI_ENDPOINT
from danswer.configs.model_configs import GEN_AI_HOST_TYPE
Expand All @@ -12,6 +13,7 @@
from danswer.direct_qa.qa_utils import get_gen_ai_api_key
from danswer.dynamic_configs.interface import ConfigNotFoundError
from danswer.llm.azure import AzureGPT
from danswer.llm.google_colab_demo import GoogleColabDemo
from danswer.llm.llm import LLM
from danswer.llm.openai import OpenAIGPT

Expand All @@ -21,6 +23,11 @@ def get_llm_from_model(model: str, **kwargs: Any) -> LLM:
if API_TYPE_OPENAI == "azure":
return AzureGPT(**kwargs)
return OpenAIGPT(**kwargs)
if (
model == DanswerGenAIModel.REQUEST.value
and kwargs.get("model_host_type") == ModelHostType.COLAB_DEMO
):
return GoogleColabDemo(**kwargs)

raise ValueError(f"Unknown LLM model: {model}")

Expand Down

1 comment on commit 499dfb5

@vercel
Copy link

@vercel vercel bot commented on 499dfb5 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.