Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
0365f1e
1
Parent(s):
548acb6
22
Browse files- utils/prompt_utils.py +15 -3
utils/prompt_utils.py
CHANGED
|
@@ -12,12 +12,24 @@ def polish_prompt(original_prompt):
|
|
| 12 |
print("Warning: HF_TOKEN is not set. Prompt enhancement is disabled.")
|
| 13 |
return original_prompt
|
| 14 |
|
| 15 |
-
client = InferenceClient(provider="cerebras", api_key=api_key)
|
| 16 |
-
messages = [
|
|
|
|
|
|
|
|
|
|
| 17 |
try:
|
| 18 |
completion = client.chat.completions.create(
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
)
|
|
|
|
|
|
|
|
|
|
| 21 |
polished_prompt = completion.choices[0].message.content
|
| 22 |
polished_prompt += " Ultra HD, 4K, cinematic composition"
|
| 23 |
return polished_prompt.strip().replace("\n", " ")
|
|
|
|
| 12 |
print("Warning: HF_TOKEN is not set. Prompt enhancement is disabled.")
|
| 13 |
return original_prompt
|
| 14 |
|
| 15 |
+
# client = InferenceClient(provider="cerebras", api_key=api_key)
|
| 16 |
+
# messages = []
|
| 17 |
+
client = InferenceClient()
|
| 18 |
+
|
| 19 |
+
|
| 20 |
try:
|
| 21 |
completion = client.chat.completions.create(
|
| 22 |
+
rovider="cerebras",
|
| 23 |
+
api_key=api_key,
|
| 24 |
+
model="openai/gpt-oss-120b",
|
| 25 |
+
messages=[
|
| 26 |
+
{"role": "system", "content": system_prompt},
|
| 27 |
+
{"role": "user", "content": original_prompt}
|
| 28 |
+
],
|
| 29 |
)
|
| 30 |
+
# completion = client.chat.completions.create(
|
| 31 |
+
# model="Qwen/Qwen3-235B-A22B-Instruct-2507", messages=messages
|
| 32 |
+
# )
|
| 33 |
polished_prompt = completion.choices[0].message.content
|
| 34 |
polished_prompt += " Ultra HD, 4K, cinematic composition"
|
| 35 |
return polished_prompt.strip().replace("\n", " ")
|