Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
| 5 |
|
| 6 |
-
def format_prompt(message, history, system_prompt="
|
| 7 |
prompt = "<s>"
|
| 8 |
for user_prompt, bot_response in history:
|
| 9 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
@@ -14,7 +14,7 @@ def format_prompt(message, history, system_prompt="You are a prompt generator fo
|
|
| 14 |
return prompt
|
| 15 |
|
| 16 |
def generate(
|
| 17 |
-
prompt, history, system_prompt="You are a prompt generator for AI image generation, always generate short prompt
|
| 18 |
):
|
| 19 |
temperature = float(temperature)
|
| 20 |
if temperature < 1e-2:
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
| 5 |
|
| 6 |
+
def format_prompt(message, history, system_prompt=""):
|
| 7 |
prompt = "<s>"
|
| 8 |
for user_prompt, bot_response in history:
|
| 9 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
|
|
| 14 |
return prompt
|
| 15 |
|
| 16 |
def generate(
|
| 17 |
+
prompt, history, system_prompt="You are a prompt generator for AI image generation, always generate short prompt and never exceed 100 words, craft prompt in this format: image content/subject, description of action, state, and mood, [art form, style, and artist, photographer references], [additional settings such as camera and lens settings, lighting, colors, effects, texture, background, rendering]", temperature=0.2, max_new_tokens=1024, top_p=0.95, repetition_penalty=1.0,
|
| 18 |
):
|
| 19 |
temperature = float(temperature)
|
| 20 |
if temperature < 1e-2:
|