Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from transformers import pipeline
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
import os
|
@@ -11,6 +11,9 @@ if not token:
|
|
11 |
|
12 |
|
13 |
model_id = "meta-llama/Llama-3.2-1B-Instruct"
|
|
|
|
|
|
|
14 |
pipe = pipeline(
|
15 |
"text-generation",
|
16 |
model=model_id,
|
|
|
1 |
+
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
import os
|
|
|
11 |
|
12 |
|
13 |
model_id = "meta-llama/Llama-3.2-1B-Instruct"
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=token)
|
15 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, use_auth_token=token)
|
16 |
+
|
17 |
pipe = pipeline(
|
18 |
"text-generation",
|
19 |
model=model_id,
|