Spaces:
Runtime error
Runtime error
AliEssa555
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,12 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
5 |
-
# Load your model and tokenizer
|
6 |
from peft import PeftModel, PeftConfig
|
7 |
from transformers import AutoModelForCausalLM
|
8 |
|
9 |
config = PeftConfig.from_pretrained("AliEssa555/latest-podcast-model-ft")
|
10 |
base_model = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-Instruct-v0.2-GPTQ")
|
11 |
-
|
12 |
|
13 |
#model_name = "path_to_your_fine_tuned_model" # Use the local path or the Hugging Face model hub ID if published
|
14 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16)
|
|
|
2 |
import torch
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
|
|
5 |
from peft import PeftModel, PeftConfig
|
6 |
from transformers import AutoModelForCausalLM
|
7 |
|
8 |
config = PeftConfig.from_pretrained("AliEssa555/latest-podcast-model-ft")
|
9 |
base_model = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-Instruct-v0.2-GPTQ")
|
10 |
+
model = PeftModel.from_pretrained(base_model, "AliEssa555/latest-podcast-model-ft")
|
11 |
|
12 |
#model_name = "path_to_your_fine_tuned_model" # Use the local path or the Hugging Face model hub ID if published
|
13 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16)
|