Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tslmy committed Jan 4, 2024
1 parent 7fd27f8 commit e203e93
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llama_hub/tools/wikipedia/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ def load_data(
lang (str): Language of Wikipedia to read. (default: English)
"""
import wikipedia

wikipedia.set_lang(lang)
try:
wikipedia_page = wikipedia.page(
page, **load_kwargs, auto_suggest=False
)
wikipedia_page = wikipedia.page(page, **load_kwargs, auto_suggest=False)
except wikipedia.PageError:
return "Unable to load page. Try searching instead."
return wikipedia_page.content
Expand Down

0 comments on commit e203e93

Please sign in to comment.