JUNGU commited on
Commit
b638764
β€’
1 Parent(s): a09d9b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -50,18 +50,12 @@ model = model.to(device)
50
  # Spaces의 GPU μžμ›μ„ μ‚¬μš©ν•˜μ—¬ chat ν•¨μˆ˜ μ‹€ν–‰. μ΅œλŒ€ 60초 λ™μ•ˆ GPU μžμ› μ‚¬μš© κ°€λŠ₯.
51
  @spaces.GPU(duration=60)
52
  def chat(message, history, temperature, do_sample, max_tokens):
53
- instruction = "You are a helpful assistant."
54
  # μ±„νŒ… 기둝을 μ μ ˆν•œ ν˜•μ‹μœΌλ‘œ λ³€ν™˜
55
  chat = []
56
  for item in history:
57
  chat.append({"role": "user", "content": item[0]})
58
  if item[1] is not None:
59
  chat.append({"role": "assistant", "content": item[1]})
60
-
61
-
62
-
63
- chat.insert(0, {"role": "system", "content": instruction})
64
-
65
  chat.append({"role": "user", "content": message})
66
 
67
  # ν† ν¬λ‚˜μ΄μ €λ₯Ό μ‚¬μš©ν•˜μ—¬ μž…λ ₯ 처리
@@ -108,7 +102,7 @@ demo = gr.ChatInterface(
108
  ),
109
  additional_inputs=[
110
  gr.Slider(
111
- minimum=0, maximum=1, step=0.1, value=0.9, label="Temperature", render=False
112
  ),
113
  gr.Checkbox(label="Sampling", value=True),
114
  gr.Slider(
 
50
  # Spaces의 GPU μžμ›μ„ μ‚¬μš©ν•˜μ—¬ chat ν•¨μˆ˜ μ‹€ν–‰. μ΅œλŒ€ 60초 λ™μ•ˆ GPU μžμ› μ‚¬μš© κ°€λŠ₯.
51
  @spaces.GPU(duration=60)
52
  def chat(message, history, temperature, do_sample, max_tokens):
 
53
  # μ±„νŒ… 기둝을 μ μ ˆν•œ ν˜•μ‹μœΌλ‘œ λ³€ν™˜
54
  chat = []
55
  for item in history:
56
  chat.append({"role": "user", "content": item[0]})
57
  if item[1] is not None:
58
  chat.append({"role": "assistant", "content": item[1]})
 
 
 
 
 
59
  chat.append({"role": "user", "content": message})
60
 
61
  # ν† ν¬λ‚˜μ΄μ €λ₯Ό μ‚¬μš©ν•˜μ—¬ μž…λ ₯ 처리
 
102
  ),
103
  additional_inputs=[
104
  gr.Slider(
105
+ minimum=0, maximum=1, step=0.1, value=0.7, label="Temperature", render=False
106
  ),
107
  gr.Checkbox(label="Sampling", value=True),
108
  gr.Slider(