[Improvements] Add support for creating app from YAML string config (#980)

This commit is contained in:
Deven Patel
2023-11-29 12:25:30 -08:00
committed by GitHub
parent e35eaf1bfc
commit 406c46e7f4
34 changed files with 351 additions and 179 deletions

View File

@@ -1,4 +1,5 @@
import importlib
import logging
import os
from typing import Optional
@@ -42,9 +43,11 @@ class HuggingFaceLlm(BaseLlm):
else:
raise ValueError("`top_p` must be > 0.0 and < 1.0")
model = config.model or "google/flan-t5-xxl"
logging.info(f"Using HuggingFaceHub with model {model}")
llm = HuggingFaceHub(
huggingfacehub_api_token=os.environ["HUGGINGFACE_ACCESS_TOKEN"],
repo_id=config.model or "google/flan-t5-xxl",
repo_id=model,
model_kwargs=model_kwargs,
)