Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -34,14 +34,14 @@ def generate_text(
|
|
| 34 |
api_key: str = Depends(get_api_key)
|
| 35 |
):
|
| 36 |
prompt = body.get("prompt", "")
|
| 37 |
-
|
| 38 |
temperature = body.get("temperature", 0.5)
|
| 39 |
top_p = body.get("top_p", 0.95)
|
| 40 |
max_new_tokens = body.get("max_new_tokens",512)
|
| 41 |
repetition_penalty = body.get("repetition_penalty", 1.0)
|
| 42 |
print(f"temperature + {temperature}")
|
| 43 |
history = [] # You might need to handle this based on your actual usage
|
| 44 |
-
formatted_prompt = format_prompt(prompt, history)
|
| 45 |
|
| 46 |
stream = client.text_generation(
|
| 47 |
formatted_prompt,
|
|
|
|
| 34 |
api_key: str = Depends(get_api_key)
|
| 35 |
):
|
| 36 |
prompt = body.get("prompt", "")
|
| 37 |
+
system_prompt = body.get("sysPrompt", "")
|
| 38 |
temperature = body.get("temperature", 0.5)
|
| 39 |
top_p = body.get("top_p", 0.95)
|
| 40 |
max_new_tokens = body.get("max_new_tokens",512)
|
| 41 |
repetition_penalty = body.get("repetition_penalty", 1.0)
|
| 42 |
print(f"temperature + {temperature}")
|
| 43 |
history = [] # You might need to handle this based on your actual usage
|
| 44 |
+
formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
|
| 45 |
|
| 46 |
stream = client.text_generation(
|
| 47 |
formatted_prompt,
|