pdx97 commited on
Commit
513f9c3
·
verified ·
1 Parent(s): e727728

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -52,7 +52,10 @@ from smolagents import CodeAgent, HfApiModel, tool
52
  from rank_bm25 import BM25Okapi
53
  import nltk
54
 
55
- nltk.download('punkt')
 
 
 
56
 
57
  @tool # Register the function properly as a SmolAgents tool
58
  def fetch_latest_arxiv_papers(keywords: list, num_results: int = 5) -> list:
 
52
  from rank_bm25 import BM25Okapi
53
  import nltk
54
 
55
+ try:
56
+ nltk.data.find("tokenizers/punkt")
57
+ except LookupError:
58
+ nltk.download("punkt")
59
 
60
  @tool # Register the function properly as a SmolAgents tool
61
  def fetch_latest_arxiv_papers(keywords: list, num_results: int = 5) -> list: