Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,19 +25,21 @@ def enhance_prompt(prompt, style="photorealistic"):
|
|
| 25 |
)
|
| 26 |
return result
|
| 27 |
|
| 28 |
-
def mistral_nemo_call(prompt, API_TOKEN, model="mistralai/Mistral-Nemo-Instruct-2407"):
|
| 29 |
|
| 30 |
client = InferenceClient(api_key=API_TOKEN)
|
| 31 |
system_prompt=f"""
|
| 32 |
You are a image generation prompt enhancer specialized in the {style} style.
|
| 33 |
You must respond only with the enhanced version of the users input prompt
|
| 34 |
Remember, image generation models can be stimulated by refering to camera 'effect' in the prompt like :4k ,award winning, super details, 35mm lens, hd
|
| 35 |
-
"""
|
| 36 |
|
| 37 |
response = ""
|
| 38 |
for message in client.chat_completion(
|
| 39 |
model=model,
|
| 40 |
-
messages=[{"role": "system", "content": system_prompt},
|
|
|
|
|
|
|
| 41 |
max_tokens=500,
|
| 42 |
stream=True,
|
| 43 |
):
|
|
|
|
| 25 |
)
|
| 26 |
return result
|
| 27 |
|
| 28 |
+
def mistral_nemo_call(prompt, API_TOKEN, model="mistralai/Mistral-Nemo-Instruct-2407", style="photo-realistic"):
|
| 29 |
|
| 30 |
client = InferenceClient(api_key=API_TOKEN)
|
| 31 |
system_prompt=f"""
|
| 32 |
You are a image generation prompt enhancer specialized in the {style} style.
|
| 33 |
You must respond only with the enhanced version of the users input prompt
|
| 34 |
Remember, image generation models can be stimulated by refering to camera 'effect' in the prompt like :4k ,award winning, super details, 35mm lens, hd
|
| 35 |
+
"""
|
| 36 |
|
| 37 |
response = ""
|
| 38 |
for message in client.chat_completion(
|
| 39 |
model=model,
|
| 40 |
+
messages=[{"role": "system", "content": system_prompt},
|
| 41 |
+
{"role": "user", "content": prompt}
|
| 42 |
+
],
|
| 43 |
max_tokens=500,
|
| 44 |
stream=True,
|
| 45 |
):
|