Skip to content

Commit

Permalink
Merge pull request #753 from axel7083/chore/adding-markdown-file-input
Browse files Browse the repository at this point in the history
chore(summarizer): adding markdown type file input
  • Loading branch information
rhatdan authored Aug 12, 2024
2 parents b61c908 + 4f0ecc8 commit 5671010
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def read_file(file):
pages = loader.load()
text = "".join([p.page_content for p in pages])

if file_type == "text/plain":
if file_type in ["text/markdown", "text/plain"]:
text = file.read().decode()

return text
Expand All @@ -86,7 +86,7 @@ def evaluate_summary(text, response):
return score

st.title("🔎 Summarizer")
file = st.file_uploader("Upload file",type=[".txt",".pdf"])
file = st.file_uploader("Upload file",type=[".txt",".pdf", ".md"])

llm = ChatOpenAI(base_url=model_service,
api_key="not required",
Expand Down

0 comments on commit 5671010

Please sign in to comment.