Update app_low.py
Browse files- app_low.py +4 -0
app_low.py
CHANGED
|
@@ -53,6 +53,10 @@ def enhance_prompt(user_prompt, temperature, max_tokens, chat_history):
|
|
| 53 |
|
| 54 |
|
| 55 |
def enhance_prompt1(user_prompt, temperature, max_tokens, chat_history):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 57 |
output = pipe(prompt, max_new_tokens=256)
|
| 58 |
print(output[0]['generated_text'])
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
def enhance_prompt1(user_prompt, temperature, max_tokens, chat_history):
|
| 56 |
+
messages = [
|
| 57 |
+
{"role": "system", "content": "Enhance and expand the following prompt with more details and context:"},
|
| 58 |
+
{"role": "user", "content": user_prompt}
|
| 59 |
+
]
|
| 60 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 61 |
output = pipe(prompt, max_new_tokens=256)
|
| 62 |
print(output[0]['generated_text'])
|