Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
@@ -1,63 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
Runs on port 7860 by default.
|
11 |
-
|
12 |
-
## Setup
|
13 |
-
|
14 |
-
1. Create and activate a Python environment (recommended).
|
15 |
-
2. Install dependencies:
|
16 |
-
|
17 |
-
```bash
|
18 |
-
pip install -r requirements.txt
|
19 |
-
```
|
20 |
-
|
21 |
-
3. Run the server:
|
22 |
-
|
23 |
-
```bash
|
24 |
-
python app.py
|
25 |
-
```
|
26 |
-
|
27 |
-
The API will be available at `http://localhost:7860`. Interactive docs: `http://localhost:7860/docs`.
|
28 |
-
|
29 |
-
## Example requests
|
30 |
-
|
31 |
-
Chat:
|
32 |
-
|
33 |
-
```bash
|
34 |
-
curl http://localhost:7860/v1/chat/completions \
|
35 |
-
-H "Content-Type: application/json" \
|
36 |
-
-d '{
|
37 |
-
"model": "LiquidAI/LFM2-1.2B",
|
38 |
-
"messages": [
|
39 |
-
{"role": "system", "content": "You are a helpful assistant."},
|
40 |
-
{"role": "user", "content": "Write a haiku about the ocean"}
|
41 |
-
],
|
42 |
-
"temperature": 0.7,
|
43 |
-
"max_tokens": 128
|
44 |
-
}'
|
45 |
-
```
|
46 |
-
|
47 |
-
Completions:
|
48 |
-
|
49 |
-
```bash
|
50 |
-
curl http://localhost:7860/v1/completions \
|
51 |
-
-H "Content-Type: application/json" \
|
52 |
-
-d '{
|
53 |
-
"model": "LiquidAI/LFM2-1.2B",
|
54 |
-
"prompt": "Explain quantum computing in simple terms",
|
55 |
-
"temperature": 0.7,
|
56 |
-
"max_tokens": 128
|
57 |
-
}'
|
58 |
-
```
|
59 |
-
|
60 |
-
## Notes
|
61 |
-
- The server auto-selects FP16/BF16 on CUDA if available, otherwise runs on CPU (slow).
|
62 |
-
- Configure with env vars: `MODEL_ID`, `MAX_TOKENS`, `PORT`.
|
63 |
-
- This minimal server supports only `n=1` and returns the first completion.
|
|
|
1 |
+
title: LFM2-1.2B
|
2 |
+
emoji: 😎
|
3 |
+
colorFrom: yellow
|
4 |
+
colorTo: green
|
5 |
+
sdk: gradio
|
6 |
+
sdk_version: 5.39.0
|
7 |
+
app_file: app.py
|
8 |
+
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|