Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -1,17 +1,47 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
-
|
5 |
-
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- text-generation
|
4 |
+
- conversational
|
5 |
+
- llama
|
6 |
+
license: mit
|
7 |
+
library_name: transformers
|
8 |
+
pipeline_tag: text-generation
|
9 |
+
---
|
10 |
+
|
11 |
+
# Chatbot Phi-3-mini Optimizado para Mac M1/M2
|
12 |
+
|
13 |
+
Modelo de chatbot optimizado para Apple Silicon basado en **Microsoft Phi-3-mini-4k-instruct** (3.8B par谩metros) con quantizaci贸n 4-bit.
|
14 |
+
|
15 |
+

|
16 |
+
|
17 |
+
## Model Details
|
18 |
+
|
19 |
+
### **Caracter铆sticas Clave**
|
20 |
+
- **Arquitectura**: Transformer-based (Llama-like)
|
21 |
+
- **Context Window**: 4K tokens
|
22 |
+
- **Quantizaci贸n**: 4-bit (bnb)
|
23 |
+
- **Hardware Target**: Apple M1/M2/M3 (GPU Metal)
|
24 |
+
- **Framework**: PyTorch 2.3+ con MPS
|
25 |
+
|
26 |
+
### **Uso Previsto**
|
27 |
+
- Asistente conversacional general
|
28 |
+
- Generaci贸n de texto en espa帽ol/ingl茅s
|
29 |
+
- Q&A contextual
|
30 |
+
|
31 |
+
## How to Use
|
32 |
+
|
33 |
+
### **Inferencia Directa**
|
34 |
+
```python
|
35 |
+
from transformers import pipeline
|
36 |
+
|
37 |
+
chatbot = pipeline(
|
38 |
+
"text-generation",
|
39 |
+
model="microsoft/Phi-3-mini-4k-instruct",
|
40 |
+
device_map="auto",
|
41 |
+
torch_dtype="auto",
|
42 |
+
trust_remote_code=True
|
43 |
+
)
|
44 |
+
|
45 |
+
messages = [{"role": "user", "content": "Explica la teor铆a de relatividad"}]
|
46 |
+
response = chatbot(messages, max_new_tokens=256)
|
47 |
+
print(response[0]['generated_text'])
|