Skip to content

Commit

Permalink
Fix model name extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSamhuns committed Sep 3, 2024
1 parent 0062a3c commit cdf0f0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/routes/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def sql_script(
async def sql_question_answer(
log_type: LogFileType,
question: str,
model: LLMModel = LLMModel.GPT_4o_Mini.value):
model: LLMModel = LLMModel.GPT_4o_Mini):
"""Converts question into sql command & interact with SQL database"""
status_code = status.HTTP_200_OK
response_data = {}
Expand Down
8 changes: 5 additions & 3 deletions app/routes/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
summary="Summarize uploaded file(s)")
async def summarize_files(
summarizer_mode: SummarizerMode,
model: LLMModel = LLMModel.Llamafile.value,
model: LLMModel = LLMModel.Llamafile,
files: List[UploadFile] = File(...),):
"""Extract text from files and summarize based on selected mode"""
response_data = {}
try:
print(f"Running summarization for files: {[file.filename for file in files]}")
llm = load_llm(model)
llm = load_llm(model.value)
if summarizer_mode == "combined":
# Combined summarization logic
combined_docs = []
Expand Down Expand Up @@ -66,11 +66,13 @@ async def summarize_files(
status_code=status.HTTP_200_OK,
summary="Summarize content(s) from url")
async def summarize_urls(
urls: List[str]):
urls: List[str],
model: LLMModel = LLMModel.Llamafile):
"""Extract text from files, summarize contents & return summary"""
status_code = status.HTTP_200_OK
response_data = {}
try:
llm = load_llm(model.value)
loader = WebBaseLoader(urls)
docs = loader.load()
chain = load_summarize_chain(llm, chain_type="stuff")
Expand Down

0 comments on commit cdf0f0e

Please sign in to comment.