Spaces:
Sleeping
Sleeping
Commit
路
22c26c5
1
Parent(s):
ef680a8
app.py
CHANGED
@@ -3,10 +3,6 @@ from transformers import pipeline
|
|
3 |
import torch
|
4 |
import spaces
|
5 |
import time
|
6 |
-
import subprocess
|
7 |
-
|
8 |
-
# Aseg煤rate de que accelerate est茅 actualizado
|
9 |
-
subprocess.run(["pip", "install", "--upgrade", "accelerate"])
|
10 |
|
11 |
# Funci贸n para verificar y esperar una GPU
|
12 |
def wait_for_gpu():
|
@@ -18,14 +14,14 @@ def wait_for_gpu():
|
|
18 |
# Espera hasta que una GPU est茅 disponible
|
19 |
wait_for_gpu()
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
#
|
28 |
-
|
29 |
|
30 |
# Instrucciones para mejorar resoluciones judiciales
|
31 |
instructions = """
|
|
|
3 |
import torch
|
4 |
import spaces
|
5 |
import time
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Funci贸n para verificar y esperar una GPU
|
8 |
def wait_for_gpu():
|
|
|
14 |
# Espera hasta que una GPU est茅 disponible
|
15 |
wait_for_gpu()
|
16 |
|
17 |
+
# Configuraci贸n del pipeline con el modelo Meta-Llama usando GPU y FP16
|
18 |
+
pipe = pipeline(
|
19 |
+
"text-generation",
|
20 |
+
model="meta-llama/Meta-Llama-3.1-70B-Instruct",
|
21 |
+
device=0,
|
22 |
+
torch_dtype=torch.float16,
|
23 |
+
low_cpu_mem_usage=True # Para reducir el uso de memoria en CPU
|
24 |
+
)
|
25 |
|
26 |
# Instrucciones para mejorar resoluciones judiciales
|
27 |
instructions = """
|