Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -796,7 +796,10 @@ def generate_response(prompt: str, max_new_tokens: int = MAX_NEW_TOKENS) -> str:
|
|
| 796 |
"""Generate response using vLLM OpenAI-compatible API."""
|
| 797 |
# Use /completions endpoint for raw prompt
|
| 798 |
url = f"{REMOTE_API_BASE}/completions"
|
| 799 |
-
headers = {
|
|
|
|
|
|
|
|
|
|
| 800 |
payload = {
|
| 801 |
"model": MODEL_NAME,
|
| 802 |
"prompt": prompt,
|
|
|
|
| 796 |
"""Generate response using vLLM OpenAI-compatible API."""
|
| 797 |
# Use /completions endpoint for raw prompt
|
| 798 |
url = f"{REMOTE_API_BASE}/completions"
|
| 799 |
+
headers = {
|
| 800 |
+
"Content-Type": "application/json",
|
| 801 |
+
"ngrok-skip-browser-warning": "true", # 绕过 ngrok 免费版的浏览器警告页面
|
| 802 |
+
}
|
| 803 |
payload = {
|
| 804 |
"model": MODEL_NAME,
|
| 805 |
"prompt": prompt,
|