Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,11 +14,13 @@ model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
|
|
14 |
@spaces.GPU(duration=240)
|
15 |
|
16 |
# Charger le modèle en spécifiant le token d'accès
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
22 |
)
|
23 |
|
24 |
# Créer un pipeline pour la génération de texte
|
|
|
14 |
@spaces.GPU(duration=240)
|
15 |
|
16 |
# Charger le modèle en spécifiant le token d'accès
|
17 |
+
|
18 |
+
pipeline = transformers.pipeline(
|
19 |
+
"text-generation",
|
20 |
+
model=model_id,
|
21 |
+
token = api_token,
|
22 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
23 |
+
device_map="auto",
|
24 |
)
|
25 |
|
26 |
# Créer un pipeline pour la génération de texte
|