Spaces:
Sleeping
Sleeping
PierreJousselin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
|
|
3 |
|
4 |
# Load the model and tokenizer from Hugging Face
|
5 |
model_name = "PierreJousselin/lora_model" # Replace with your model's name or path
|
6 |
-
model =
|
|
|
|
|
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
# Define the chat function
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoTokenizer
|
3 |
+
from peft import AutoPeftModelForCausalLM
|
4 |
|
5 |
# Load the model and tokenizer from Hugging Face
|
6 |
model_name = "PierreJousselin/lora_model" # Replace with your model's name or path
|
7 |
+
model = AutoPeftModelForCausalLM.from_pretrained(
|
8 |
+
model_name,
|
9 |
+
|
10 |
+
)
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
12 |
|
13 |
# Define the chat function
|