seawolf2357 commited on
Commit
9a766b3
β€’
1 Parent(s): 672b059

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -87,8 +87,11 @@ async def extract_keywords(message):
87
  response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(
88
  messages, max_tokens=10, temperature=0.7, top_p=0.85))
89
 
90
- # LLM 응닡은 ν…μŠ€νŠΈμΌ 수 μžˆμœΌλ―€λ‘œ λ‹¨μˆœνžˆ κ²°ν•©ν•˜μ—¬ λ°˜ν™˜
91
- keywords = response.strip()
 
 
 
92
  logging.debug(f'Extracted keywords: {keywords}')
93
  return keywords
94
 
 
87
  response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(
88
  messages, max_tokens=10, temperature=0.7, top_p=0.85))
89
 
90
+ # Hugging Face 응닡 νŒŒμ‹±
91
+ if response.choices and response.choices[0].message:
92
+ keywords = response.choices[0].message['content'].strip()
93
+ else:
94
+ keywords = ""
95
  logging.debug(f'Extracted keywords: {keywords}')
96
  return keywords
97