seawolf2357 commited on
Commit
0ca4e05
ยท
verified ยท
1 Parent(s): c6c7efd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -123,11 +123,11 @@ hf_client = InferenceClient("CohereForAI/c4ai-command-r-plus-08-2024", token=HF_
123
 
124
  def summarize_article(title, snippet):
125
  try:
126
- prompt = f"๋‹ค์Œ ๋‰ด์Šค ์ œ๋ชฉ๊ณผ ์š”์•ฝ์„ ๋ฐ”ํƒ•์œผ๋กœ ํ•œ๊ตญ์–ด๋กœ 3๋ฌธ์žฅ์œผ๋กœ ์š”์•ฝํ•˜์„ธ์š”:\n์ œ๋ชฉ: {title}\n์š”์•ฝ: {snippet}"
127
  summary = hf_client.text_generation(prompt, max_new_tokens=500)
128
  return summary
129
  except Exception as e:
130
- return f"์š”์•ฝ ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ: {str(e)}"
131
 
132
  css = """
133
  footer {
 
123
 
124
  def summarize_article(title, snippet):
125
  try:
126
+ prompt = f"๋‹ค์Œ ๋‰ด์Šค ์ œ๋ชฉ๊ณผ ์š”์•ฝ์„ ๋ฐ”ํƒ•์œผ๋กœ ํ•œ๊ตญ์–ด๋กœ 1๋ฌธ์žฅ์œผ๋กœ ๊ธ์ • ๋˜๋Š” ์ค‘๋ฆฝ ๋˜๋Š” ๋ถ€์ •์  ์„ฑ๊ฒฉ์˜ ๊ธฐ์‚ฌ์ธ์ง€ ํŒ๋‹จํ•˜๋ผ.:\n์ œ๋ชฉ: {title}\n์š”์•ฝ: {snippet}"
127
  summary = hf_client.text_generation(prompt, max_new_tokens=500)
128
  return summary
129
  except Exception as e:
130
+ return f"๋ถ„์„์„ ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ: {str(e)}"
131
 
132
  css = """
133
  footer {