Jangai commited on
Commit
48a98b7
·
verified ·
1 Parent(s): feb4867

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -16,7 +16,7 @@ SD_API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-dif
16
 
17
  def query_zephyr(linkedin_text):
18
  # Constructing a single string prompt that combines the instruction with the LinkedIn post text
19
- prompt = f"Prepare a prompt for Stable Diffusion for the following LinkedIn post: {linkedin_text}"
20
 
21
  headers = {
22
  "Authorization": f"Bearer {ZEPHYR_API_TOKEN}",
@@ -25,7 +25,9 @@ def query_zephyr(linkedin_text):
25
 
26
  # The `inputs` field now directly contains the prompt string
27
  payload = {
28
- "inputs": prompt,
 
 
29
  }
30
 
31
  response = requests.post(ZEPHYR_API_URL, headers=headers, json=payload)
 
16
 
17
  def query_zephyr(linkedin_text):
18
  # Constructing a single string prompt that combines the instruction with the LinkedIn post text
19
+ prompt = f"Prepare a prompt for Stable Diffusion for the following LinkedIn post:"
20
 
21
  headers = {
22
  "Authorization": f"Bearer {ZEPHYR_API_TOKEN}",
 
25
 
26
  # The `inputs` field now directly contains the prompt string
27
  payload = {
28
+
29
+ "role": "system", "content": prompt,
30
+ "role": "user", "content": linkedin_text
31
  }
32
 
33
  response = requests.post(ZEPHYR_API_URL, headers=headers, json=payload)