From bebe96cd1919ec362618def40ad3e6a8e4f92e9b Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 18 Jul 2023 14:49:12 -0400 Subject: [PATCH] clean up Former-commit-id: 404f230e3516134aa33c34a47a55cd9aae8f91dd --- llm.py | 5 +++++ swarms/utils/llm.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 llm.py diff --git a/llm.py b/llm.py new file mode 100644 index 00000000..1906ca7c --- /dev/null +++ b/llm.py @@ -0,0 +1,5 @@ +# example +from swarms.utils.llm import LLM +llm_instance = LLM(hf_repo_id="google/flan-t5-xl", hf_api_token="your_hf_api_token") +result = llm_instance.run("Who won the FIFA World Cup in 1998?") +print(result) \ No newline at end of file diff --git a/swarms/utils/llm.py b/swarms/utils/llm.py index a77e1564..6fa46e0f 100644 --- a/swarms/utils/llm.py +++ b/swarms/utils/llm.py @@ -2,7 +2,9 @@ from typing import Optional import os import logging -from langchain import PromptTemplate, HuggingFaceHub, ChatOpenAI, LLMChain +from langchain import PromptTemplate, LLMChain, HuggingFaceHub +from langchain.chat_models import ChatOpenAI + # Configure logging- logging.basicConfig(level=logging.INFO)