[Improvements] Add support for creating app from YAML string config (#980)
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user