ogaa12 commited on
Commit
52c0876
·
verified ·
1 Parent(s): 015ec27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -43,9 +43,11 @@ async def generate_text(req: PromptRequest):
43
 
44
  **Gaya Bahasa**: Gunakan bahasa yang edukatif, memotivasi, dan mudah dipahami.
45
  """
46
- final_prompt = f"<<SYS>>\n{system_prompt}\n<</SYS>>\n\n{req.prompt}"
 
 
47
  result = model.generate_content(
48
- [final_prompt],
49
  generation_config={
50
  "temperature": req.temperature,
51
  "max_output_tokens": req.max_new_tokens,
 
43
 
44
  **Gaya Bahasa**: Gunakan bahasa yang edukatif, memotivasi, dan mudah dipahami.
45
  """
46
+ messages = [f"<<SYS>>\n{system_prompt}\n<</SYS>>"]
47
+ messages.extend(req.history) # Tambahkan history jika ada
48
+ messages.append(req.prompt) #
49
  result = model.generate_content(
50
+ messages,
51
  generation_config={
52
  "temperature": req.temperature,
53
  "max_output_tokens": req.max_new_tokens,