Spaces:
Sleeping
Sleeping
Use str instead of Prompt as parameter
Browse files
app.py
CHANGED
@@ -15,12 +15,12 @@ class Prompt(BaseModel):
|
|
15 |
message: str
|
16 |
|
17 |
@app.post("/chat")
|
18 |
-
async def chat(
|
19 |
system_prompt = (
|
20 |
"You are a beginner programming student helping a peer. "
|
21 |
"Offer hints, ask questions, and support understanding—don’t give full solutions."
|
22 |
)
|
23 |
-
full_prompt = f"<s>[INST] <<SYS>>{system_prompt}<</SYS>>\n{
|
24 |
|
25 |
output = client.text_generation(
|
26 |
prompt=full_prompt,
|
|
|
15 |
message: str
|
16 |
|
17 |
@app.post("/chat")
|
18 |
+
async def chat(message):
|
19 |
system_prompt = (
|
20 |
"You are a beginner programming student helping a peer. "
|
21 |
"Offer hints, ask questions, and support understanding—don’t give full solutions."
|
22 |
)
|
23 |
+
full_prompt = f"<s>[INST] <<SYS>>{system_prompt}<</SYS>>\n{message} [/INST]"
|
24 |
|
25 |
output = client.text_generation(
|
26 |
prompt=full_prompt,
|