z00logist commited on
Commit
01668ec
·
verified ·
1 Parent(s): d8744e8

remove parameters

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -25,12 +25,7 @@ def summarize_articles(topic: str) -> str:
25
  return "Error: Hugging Face API token is not set. Please set the HF_API_TOKEN environment variable."
26
 
27
  MODEL_REPO_ID = "Qwen/Qwen2.5-72B-Instruct"
28
- parameters = {
29
- "max_new_tokens": 200,
30
- "do_sample": False,
31
- "num_beams": 5,
32
- "early_stopping": True
33
- }
34
  client = InferenceClient(model=MODEL_REPO_ID, token=HF_API_TOKEN)
35
 
36
  search_results = wikipedia.search(topic, results=5)
@@ -40,7 +35,7 @@ def summarize_articles(topic: str) -> str:
40
  page = wikipedia.page(title)
41
  content = page.content[:4000]
42
  prompt = f"Summarize the following text:\n\n{content}\n\nSummary:"
43
- response = client.text_generation(prompt, params=parameters)
44
  summary = response.get("generated_text", "").strip()
45
  url = str(URL(page.url))
46
  summaries.append(f"URL: {url}\n\nSummary:\n{summary}\n{'-'*80}")
 
25
  return "Error: Hugging Face API token is not set. Please set the HF_API_TOKEN environment variable."
26
 
27
  MODEL_REPO_ID = "Qwen/Qwen2.5-72B-Instruct"
28
+
 
 
 
 
 
29
  client = InferenceClient(model=MODEL_REPO_ID, token=HF_API_TOKEN)
30
 
31
  search_results = wikipedia.search(topic, results=5)
 
35
  page = wikipedia.page(title)
36
  content = page.content[:4000]
37
  prompt = f"Summarize the following text:\n\n{content}\n\nSummary:"
38
+ response = client.text_generation(prompt)
39
  summary = response.get("generated_text", "").strip()
40
  url = str(URL(page.url))
41
  summaries.append(f"URL: {url}\n\nSummary:\n{summary}\n{'-'*80}")