Spaces:
Runtime error
Runtime error
lionelgarnier
commited on
Commit
·
c9afdec
1
Parent(s):
c1729b4
remove kwargs
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def get_text_gen_pipeline():
|
|
44 |
model="mistralai/Mistral-7B-Instruct-v0.3",
|
45 |
max_new_tokens=2048,
|
46 |
device=device,
|
47 |
-
model_kwargs={"add_prefix_space": False}
|
48 |
)
|
49 |
except Exception as e:
|
50 |
print(f"Error loading text generation model: {e}")
|
@@ -58,7 +58,7 @@ def refine_prompt(prompt):
|
|
58 |
return "Text generation model is unavailable."
|
59 |
try:
|
60 |
messages = [
|
61 |
-
{"role": "system", "content": "You are a product designer. You will get a basic prompt of product request and you need to imagine a new product design to satisfy that need. Produce an extended description of product front view that will be used by a text-to-image AI (Flux) to generate a visual. The prompt should be in the form of a product description, not a story. Mention the visual aesthetics. Background should be a white background."},
|
62 |
{"role": "user", "content": prompt},
|
63 |
]
|
64 |
refined_prompt = text_gen(messages)
|
|
|
44 |
model="mistralai/Mistral-7B-Instruct-v0.3",
|
45 |
max_new_tokens=2048,
|
46 |
device=device,
|
47 |
+
#model_kwargs={"add_prefix_space": False}
|
48 |
)
|
49 |
except Exception as e:
|
50 |
print(f"Error loading text generation model: {e}")
|
|
|
58 |
return "Text generation model is unavailable."
|
59 |
try:
|
60 |
messages = [
|
61 |
+
{"role": "system", "content": "You are a product designer. You will get a basic prompt of product request and you need to imagine a new product design to satisfy that need. Produce an extended description of product front view that will be used by a text-to-image AI (Flux) to generate a visual. The prompt should be in the form of a product description, not a story, maximum 2048 tokens. Mention the visual aesthetics. Background should be a white background."},
|
62 |
{"role": "user", "content": prompt},
|
63 |
]
|
64 |
refined_prompt = text_gen(messages)
|