devvtaco commited on
Commit
dc5e80d
Β·
verified Β·
1 Parent(s): fb5e935

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -19,9 +19,17 @@ def chat_with_model(message, history):
19
  if not loading_done:
20
  return history + [[message, "⚠️ λͺ¨λΈμ΄ 아직 λ‘œλ”© μ€‘μž…λ‹ˆλ‹€. μž μ‹œλ§Œ κΈ°λ‹€λ € μ£Όμ„Έμš”."]]
21
 
22
- prompt = f"λ‹€μŒ λ¬Έμž₯을 λΆ„μ„ν•˜κ³ , λ¬΄λ‘€ν•˜κ±°λ‚˜ 곡격적인 ν‘œν˜„μ΄ 있으면 μ•Œλ €μ£Όκ³  더 예의 있게 λ°”κΏ”μ€˜:\n\n{message}"
 
 
 
 
 
 
 
23
  response = chat_model(prompt, max_new_tokens=200)[0]['generated_text']
24
- return history + [[message, response]]
 
25
 
26
  # μƒνƒœ ν…μŠ€νŠΈ λ°˜ν™˜ ν•¨μˆ˜ (맀번 μƒˆλ‘œ μ½μ–΄μ˜΄)
27
  def get_status():
 
19
  if not loading_done:
20
  return history + [[message, "⚠️ λͺ¨λΈμ΄ 아직 λ‘œλ”© μ€‘μž…λ‹ˆλ‹€. μž μ‹œλ§Œ κΈ°λ‹€λ € μ£Όμ„Έμš”."]]
21
 
22
+ prompt = f"""
23
+ ### Instruction: λ‹€μŒ λ¬Έμž₯을 λΆ„μ„ν•΄μ„œ λ¬΄λ‘€ν•˜κ±°λ‚˜ 곡격적인 ν‘œν˜„μ΄ μžˆλŠ”μ§€ νŒλ‹¨ν•˜κ³ , μžˆλ‹€λ©΄ 더 예의 있게 고쳐쀘.
24
+
25
+ ### Input:
26
+ {message}
27
+
28
+ ### Response:
29
+ """
30
  response = chat_model(prompt, max_new_tokens=200)[0]['generated_text']
31
+ response_only = response[len(prompt):].strip()
32
+ return history + [[message, response_only]]
33
 
34
  # μƒνƒœ ν…μŠ€νŠΈ λ°˜ν™˜ ν•¨μˆ˜ (맀번 μƒˆλ‘œ μ½μ–΄μ˜΄)
35
  def get_status():