AIencoder commited on
Commit
d6aeaf3
·
verified ·
1 Parent(s): e1c90cf

v9: footer URLs corrected — Gradio 5 uses /gradio_api/call/, not /api/

Browse files
Files changed (1) hide show
  1. app.py +18 -3
app.py CHANGED
@@ -235,9 +235,24 @@ with gr.Blocks(title="turbocpp — llama.cpp + TurboQuant") as demo:
235
 
236
  gr.Markdown(
237
  "---\n"
238
- "**API**: every button is a named endpoint — POST to "
239
- "`/api/generate`, `/api/visualize`, `/api/status`. Or use "
240
- "`gradio_client.Client('AIencoder/turboquant-visualizer').predict(...)`."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  )
242
 
243
 
 
235
 
236
  gr.Markdown(
237
  "---\n"
238
+ "### Use the API\n"
239
+ "**Python (recommended):**\n"
240
+ "```python\n"
241
+ "from gradio_client import Client\n"
242
+ "c = Client('AIencoder/turboquant-visualizer')\n"
243
+ "out, stats = c.predict(prompt='Hi', max_tokens=64, temperature=0.7,\n"
244
+ " api_name='/generate')\n"
245
+ "```\n"
246
+ "**Raw HTTP** (Gradio 5 uses the `/gradio_api/call/` prefix):\n"
247
+ "```bash\n"
248
+ "curl -X POST https://aiencoder-turboquant-visualizer.hf.space/gradio_api/call/generate \\\n"
249
+ " -H 'content-type: application/json' \\\n"
250
+ " -d '{\"data\":[\"Hi\", 64, 0.7]}'\n"
251
+ "# returns an EVENT_ID; then GET /gradio_api/call/generate/<EVENT_ID> for the result\n"
252
+ "```\n"
253
+ "Endpoints: `/generate`, `/visualize`, `/status`. "
254
+ "Full machine-readable spec at "
255
+ "[`/gradio_api/info`](https://aiencoder-turboquant-visualizer.hf.space/gradio_api/info)."
256
  )
257
 
258