Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,12 +45,12 @@ async def extract_code_blocks(markdown_text):
|
|
45 |
|
46 |
return code_blocks
|
47 |
|
48 |
-
async def generate_infographic(
|
49 |
generated_completion = client.chat.completions.create(
|
50 |
model="llama-3.1-70b-versatile",
|
51 |
messages=[
|
52 |
{"role": "system", "content": SYSTEM_INSTRUCT},
|
53 |
-
{"role": "user", "content":
|
54 |
],
|
55 |
temperature=0.5,
|
56 |
max_tokens=5000,
|
@@ -73,7 +73,7 @@ async def serve_frontend():
|
|
73 |
async def generate_infographic(request: InfographicRequest):
|
74 |
description = request.description
|
75 |
prompt = PROMPT_TEMPLATE.format(description=description)
|
76 |
-
code_blocks= await generate_infographic(
|
77 |
if code_blocks:
|
78 |
return JSONResponse(content={"html": code_blocks[0]})
|
79 |
else:
|
|
|
45 |
|
46 |
return code_blocks
|
47 |
|
48 |
+
async def generate_infographic(prompt):
|
49 |
generated_completion = client.chat.completions.create(
|
50 |
model="llama-3.1-70b-versatile",
|
51 |
messages=[
|
52 |
{"role": "system", "content": SYSTEM_INSTRUCT},
|
53 |
+
{"role": "user", "content": prompt}
|
54 |
],
|
55 |
temperature=0.5,
|
56 |
max_tokens=5000,
|
|
|
73 |
async def generate_infographic(request: InfographicRequest):
|
74 |
description = request.description
|
75 |
prompt = PROMPT_TEMPLATE.format(description=description)
|
76 |
+
code_blocks= await generate_infographic(prompt)
|
77 |
if code_blocks:
|
78 |
return JSONResponse(content={"html": code_blocks[0]})
|
79 |
else:
|