Update README.md
Browse files
README.md
CHANGED
|
@@ -12,14 +12,17 @@ license: mit
|
|
| 12 |
|
| 13 |
# Mistral-7B API Server
|
| 14 |
|
| 15 |
-
Questo Space fornisce un'API compatibile con OpenAI per il modello Mistral-7B-Instruct-v0.2.
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
## Caratteristiche
|
| 18 |
- Versione quantizzata GGUF del modello Mistral-7B-Instruct-v0.2
|
| 19 |
- API compatibile con OpenAI
|
| 20 |
-
- Interfaccia di test Gradio per verificare il funzionamento del modello
|
| 21 |
|
| 22 |
-
##
|
| 23 |
```python
|
| 24 |
import requests
|
| 25 |
import json
|
|
@@ -44,4 +47,20 @@ response = requests.post(
|
|
| 44 |
)
|
| 45 |
|
| 46 |
print(json.dumps(response.json(), indent=2))
|
| 47 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Mistral-7B API Server
|
| 14 |
|
| 15 |
+
Questo Space fornisce un'API compatibile con OpenAI per il modello Mistral-7B-Instruct-v0.2.
|
| 16 |
+
|
| 17 |
+
- 🔗 **Interfaccia Gradio**: [Apri l'interfaccia](https://huggingface.co/spaces/<username>/Mistral-7B-API/gradio)
|
| 18 |
+
- 🧠 **Endpoint API**: `POST /v1/chat/completions`
|
| 19 |
|
| 20 |
## Caratteristiche
|
| 21 |
- Versione quantizzata GGUF del modello Mistral-7B-Instruct-v0.2
|
| 22 |
- API compatibile con OpenAI
|
| 23 |
+
- Interfaccia di test Gradio per verificare il funzionamento del modello
|
| 24 |
|
| 25 |
+
## Esempio di utilizzo con `requests`
|
| 26 |
```python
|
| 27 |
import requests
|
| 28 |
import json
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
print(json.dumps(response.json(), indent=2))
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Esempio `cURL`
|
| 53 |
+
```bash
|
| 54 |
+
curl -X POST https://huggingface.co/spaces/<username>/Mistral-7B-API/v1/chat/completions \
|
| 55 |
+
-H "Content-Type: application/json" \
|
| 56 |
+
-d '{
|
| 57 |
+
"model": "mistral-7b-instruct",
|
| 58 |
+
"messages": [{"role": "user", "content": "Spiegami la fotosintesi clorofilliana."}],
|
| 59 |
+
"temperature": 0.7,
|
| 60 |
+
"max_tokens": 1024
|
| 61 |
+
}'
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Note
|
| 65 |
+
- L'interfaccia Gradio è montata su `/gradio` per evitare conflitti con le risorse statiche dell'app.
|
| 66 |
+
- L'API è compatibile con strumenti come Postman, cURL e client Python.
|