Update README.md
Browse files
README.md
CHANGED
|
@@ -1,47 +1,47 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Mistral-7B-API
|
| 3 |
-
emoji: 🤖
|
| 4 |
-
colorFrom: indigo
|
| 5 |
-
colorTo: purple
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: mit
|
| 11 |
-
---
|
| 12 |
-
|
| 13 |
-
# Mistral-7B API Server
|
| 14 |
-
|
| 15 |
-
Questo Space fornisce un'API compatibile con OpenAI per il modello Mistral-7B-Instruct-v0.2. L'API è accessibile tramite l'endpoint `/v1/chat/completions`.
|
| 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 |
-
## API Usage
|
| 23 |
-
```python
|
| 24 |
-
import requests
|
| 25 |
-
import json
|
| 26 |
-
|
| 27 |
-
headers = {
|
| 28 |
-
"Content-Type": "application/json"
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
data = {
|
| 32 |
-
"model": "mistral-7b-instruct",
|
| 33 |
-
"messages": [
|
| 34 |
-
{"role": "user", "content": "Quali sono le principali città italiane?"}
|
| 35 |
-
],
|
| 36 |
-
"temperature": 0.7,
|
| 37 |
-
"max_tokens": 1024
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
response = requests.post(
|
| 41 |
-
"https://huggingface.co/spaces/[username]/Mistral-7B-API/v1/chat/completions",
|
| 42 |
-
headers=headers,
|
| 43 |
-
json=data
|
| 44 |
-
)
|
| 45 |
-
|
| 46 |
-
print(json.dumps(response.json(), indent=2))
|
| 47 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Mistral-7B-API
|
| 3 |
+
emoji: 🤖
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.30.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Mistral-7B API Server
|
| 14 |
+
|
| 15 |
+
Questo Space fornisce un'API compatibile con OpenAI per il modello Mistral-7B-Instruct-v0.2. L'API è accessibile tramite l'endpoint `/v1/chat/completions`.
|
| 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 |
+
## API Usage
|
| 23 |
+
```python
|
| 24 |
+
import requests
|
| 25 |
+
import json
|
| 26 |
+
|
| 27 |
+
headers = {
|
| 28 |
+
"Content-Type": "application/json"
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
data = {
|
| 32 |
+
"model": "mistral-7b-instruct",
|
| 33 |
+
"messages": [
|
| 34 |
+
{"role": "user", "content": "Quali sono le principali città italiane?"}
|
| 35 |
+
],
|
| 36 |
+
"temperature": 0.7,
|
| 37 |
+
"max_tokens": 1024
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
response = requests.post(
|
| 41 |
+
"https://huggingface.co/spaces/[username]/Mistral-7B-API/v1/chat/completions",
|
| 42 |
+
headers=headers,
|
| 43 |
+
json=data
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
print(json.dumps(response.json(), indent=2))
|
| 47 |
```
|