Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,8 @@ if not ZEPHYR_API_TOKEN or not SD_API_TOKEN:
|
|
14 |
ZEPHYR_API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
|
15 |
SD_API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
16 |
|
|
|
|
|
17 |
headers = {
|
18 |
"Authorization": f"Bearer {ZEPHYR_API_TOKEN}",
|
19 |
"Content-Type": "application/json",
|
@@ -38,14 +40,6 @@ SD_API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-dif
|
|
38 |
print(response.text) # Provides insight into what went wrong
|
39 |
return None
|
40 |
|
41 |
-
# Example LinkedIn post text
|
42 |
-
linkedin_text = "Example LinkedIn post content here. How should this be visualized?"
|
43 |
-
zephyr_response = query_zephyr_system_user_format(linkedin_text)
|
44 |
-
if zephyr_response:
|
45 |
-
print(zephyr_response)
|
46 |
-
else:
|
47 |
-
print("Error querying the Zephyr model.")
|
48 |
-
|
49 |
|
50 |
def generate_image_from_prompt(prompt, negative_prompt, guidance_scale, width, height, num_inference_steps):
|
51 |
headers = {"Authorization": f"Bearer {SD_API_TOKEN}"}
|
|
|
14 |
ZEPHYR_API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
|
15 |
SD_API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
16 |
|
17 |
+
|
18 |
+
def query_zephyr(linkedin_text):
|
19 |
headers = {
|
20 |
"Authorization": f"Bearer {ZEPHYR_API_TOKEN}",
|
21 |
"Content-Type": "application/json",
|
|
|
40 |
print(response.text) # Provides insight into what went wrong
|
41 |
return None
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
def generate_image_from_prompt(prompt, negative_prompt, guidance_scale, width, height, num_inference_steps):
|
45 |
headers = {"Authorization": f"Bearer {SD_API_TOKEN}"}
|